63 points · by djha-skin · 4y ago · 88 comments
(I'm also confused who's enthusiastically upvoting 3-paragraph long text blogs).
52.7 points/minute :: "Sauna use as a lifestyle practice to extend healthspan (sciencedirect.com)"
38.0 points/minute :: "Japan WWII poison gas agents still scarring people today (mainichi.jp)"
36.8 points/minute :: "Baker's Math (thefreshloaf.com)"
36.0 points/minute :: "Cobra Maneuver (wikipedia.org)"
36.0 points/minute :: "I Just Can't Kick Lisp (djha.skin)"
33.0 points/minute :: "Ubisoft+Bungie Scrambling to Evacuate Players Games from Capsizing Google Stadia (forbes.com/sites/paultassi)"
&c...(IE: assuming more Americans are in hn, you would want to pay at the American hours and get more votes over a shorter amount of time)
so you just switched religions ?
Another factor usually ignored, is that when coding as a team, code is read way more often than written/modified.
The success of a language has a lot to do on how easy it is to read code written by others, but without making readability too cumbersome to write for (e.g. AppleScript is easy to read, but hard to write).
Too much flexibility hampers understanding.
It's a balancing act, and in the end, a popularity contest.
The most widely used languages are likely best for most projects. There's a reason why they are successful.
Lisp offered me the freedom to think (and program) in abstract terms. As did (and does), BTW, Perl (especially with regexps, another great abstract tool), where memory management is nothing to care about unless your RAM isn't sufficient ;-0)
When I had to describe the different programming languages to lay people, I used to compare programming in Lisp with using a helicopter and a camera to collect data for map production, while other languages are similar to some earth bound vehicles and a tape measure. Yes, learning to fly a helicopter is more complicated than learning to drive (a bicycle or car) but once you managed the learning curve, you could produce much better results much faster (aka prototyping). And, of course, there are fewer pilots than drivers to chat with.
Here's an interesting (not so recent) talk by Peter Norvig where he summarized the Lisp perspective:
"Lisp: Where Do We Come From? What Are We? Where Are We Going?" http://www.norvig.com/lisp_talk_final.htm
Some of the milestones along the way: - Developed 3D animation software used to animate the dinosaurs in “Jurassic Park”. - Software R&D lead for CGI feature “Final Fantasy: The Spirits Within”. - Senior Software Developer on “The Hobbit” films.
Now I have returned to Common Lisp with a new open source 3D system [2], and it feels really good. As I deliberate over innumerable design decisions, the one thing I have told myself I will not consider changing is the choice of language. New, popular, hot, trendy languages (Clojure, Julia) may monopolize the conversation, but I am content with what Common Lisp allows me to do.
[1]: https://kaveh808.medium.com/late-night-lisp-machine-hacking-... [2]: https://github.com/kaveh808/kons-9
I should re-read the Norvig paper...
No need for planning storage most of the time in modern languages, even modern C++ you can just say
std::string s = "hello";
s += " world!";
And the string will automatically resize to fit "hello world!"That article by mfiano focuses on reasons the author switched from Lisp to Julia. As for the "loners" part, mfiano says this:
> This hints at a very real problem with Common Lisp: it has a tendency to attract people that employ the 'NIH syndrome' and refuse to collaborate. There is a large overlap of software available, and there is a large selection of low-hanging fruit for new developers. This coupled with the fact that the language is small, relatively speaking, hurts the language immensely.
Contrast this with how djha (TFA) puts it:
> I feel like Lisp is custom built for high functioning, high quality, low-head-count teams. I kinda feel like most of my projects into this category.
So TFA is kind of taking liberties with mfiano's post. I might come down to whether or not you view NIH syndrome as a net positive or negative.
sounds like heaven
There are multiple people who submit patches to free Lisp software. There are companies where Lisp people work together. There is free help offered in various Lisp fora.
Perhaps the author didn't receive free help on his own projects? Perhaps he didn't offer free help on other people's projects?
Personally I've never felt ashamed to roll up my sleeves and get some oil in my beard with C++. Perl, Python or really filthy Bash scripting.
But having learned Lisp (SICP) back in the 80s, It does sometimes feel like I took Latin and Greek at prep-school, and ever since have been slumming it with my working class coder pals.
Total geek snobbery for sure. But is there anything in it? Please say no.
From the outside, I didn't see any evidence of this. The people who were better and more experienced engineers tended to produce more, better, and faster. I saw that they were happier using the tools of choice. As far as I could tell the supposed extra productivity over Rails or some other modern framework for the task at hand was largely illusory.
On the one hand, happier engineers is good. On the other hand, code in relatively obscure languages is more difficult to find people to maintain and libraries are less likely to be kept patched by the community. It's a tradeoff. I wouldn't say one is better.
The primary gain from Lisp and similar is, in my experience, not that it's useful for writing software. It's that learning a different approach teaches you new ways to attack problems. Sometimes those are useful.
I don’t think the claim is that one has to use those older technologies exclusively. I read the GP’s comment as that the knowledge one gains by learning those older technologies gives one more tools in their bag when using modern technology.
> The primary gain from Lisp and similar is, in my experience, not that it's useful for writing software. It's that learning a different approach teaches you new ways to attack problems. Sometimes those are useful.
Exactly. An example: trying to learn functional programming? Erlang will force one into that mindset. It is natural to spot mapping, folding, flattening in any other language later on. Working with local data, or state machines becomes a habit because there’s no other way of doing things in Erlang. That knowledge is directly applicable in any other language.
This exactly describes my experience with Clojure. Sure, I learned “functional programming” which was a “different paradigm”, but at the end of the day what I learned was how to reason about:
1. Whether some bit of state is intrinsic, not strictly necessary but it is highly convenient, or neither of those. (The highly convenient case in Clojure is mostly a reference to Transients[1], which I don’t think I ever used. But the concept has been incredibly valuable when transferring what I’d learned to more imperative languages.)
2. There are correct and obvious function boundaries even for quite a lot of domain specific code, and they usually become evident while you work if the previous point is applied judiciously.
3. Some general purpose abstractions are so self-evidently useful that adopting them is never premature. (Here I’m thinking of what Clojure abstracts as `seq` and the enormous set of functions which operate on `seq`-conforming collection types. Other FP languages similarly bring their own wealth of broadly applicable abstractions.)
4. Many, maybe most, functions have a correct parameter order, which is the order you’d use for true lambdas. Once learned, it can almost always be applied subconsciously.
5. Metaprogramming is good, actually, if you have a good reason to do it. And having a good foundation for metaprogramming is invaluable even if its value is hard to elucidate. (Macros, of course. But I’d give my figurative left kidney to have time to explore the kinds of problems I could potentially solve with Racket’s language-oriented features.)
For another day or at least a later comment, 6. Lack of static types in most lisps hilariously undermines each one of the points above.
This knowledge is then applicable to any other programming language.
The syntax is just off-putting and I was never compelled to learn it in school, so I remain in algol-land. If time and focus allowed I'd do the SICP self study path but it's too easy to surf HN and Reddit instead.
Algol languages on the other hand, and math even on paper, are a rather wild bunch: they mix infix operators like plus/minus (1+1), multiplication/division (2*2), have postfix operators like faculty (9!) and even user defined functions f(x, y) in prefix notation. That should be way more off-putting theoretically, but people just grew up with this "mess" and think that fine.
Disclaimer: besides Lisp, I program in Perl or Shell too ;-)
Source code is actually simple nested list data. For example the following snippet, which binds two variables A and B, defines a local function and then calls this local function. This is just an s-expression, which consists of symbols, numbers and lists.
Even though s-expressions have a syntax with numbers, parentheses, symbols, ... - they can not only be written in a text editor, one can also directly compute with them using the typical Lisp operators for lists, numbers, strings, symbols, ...
The following enters literal data, which is not executed as code.
CL-USER 5 > '(let ((a (+ 1 2))
(b (* 2 3)))
(flet ((add3 (a b)
(+ 3 a b)))
(add3 a b)))
(LET ((A (+ 1 2))
(B (* 2 3)))
(FLET ((ADD3 (A B)
(+ 3 A B)))
(ADD3 A B)))
We can substitute the symbol * with the symbol expt in this s-expression - the variable * just holds the last evaluation result: CL-USER 6 > (subst 'expt '* *)
(LET ((A (+ 1 2))
(B (EXPT 2 3)))
(FLET ((ADD3 (A B)
(+ 3 A B)))
(ADD3 A B)))
Then this can be evaluated: CL-USER 7 > (eval *)
14
Now, even though the program is written as a data structure, the Lisp program itself has syntax. Only function calls have the simple (operator args...) syntax. But there are also special forms and macro forms.LET is a syntactic form and expects a list of (variable value) pairs as its first sub-expression. Then follows a body of subexpressions, where the variables can be used.
FLET is a another syntactic form: it expects a list of function definitions and a body. The function definition starts with a name, followed by an arglist and then by a body.
In reality this is more complex, since LET and FLET allow declarations, functions allow complex argument lists, declarations, documentations, etc.
So for FLET the top-level EBNF syntax would be like:
flet ((function-name lambda-list
[[local-declaration* | local-documentation]]
local-form*)*)
declaration*
form*
With more syntax for lambda-list, declaration, documentation and form. well->people[2].are(likely, to, like, this, better);
compared to this ((Person->are ((array-at (Prefix->people well) 2)) ....
Please fix it for me, I can't be bothered.(Yes, this is an exaggerated example but this really is the point. Also, static types. If there's anything of overarching regularity in what you type, it better be syntax or it will be hard to check and take advantage of. This is what Algol-style languages do for systems programming.)
(peopler-simplifier well people 2 are likely to like this better)
This is where generally macros & helper functions in lisp actually produce a new "syntax", rather than leverage a large language provided one.This to me is actually the crisis for lisp. Any codebase requires you to learn all the various macros that do:
peopler-simplifier == $1->$2[$3].$4($5, $6 $7 $8 $9);I recently made a comment on this topic here:
https://news.ycombinator.com/item?id=33049170
There are probably some engineers who have "dyslispia", to whom the normal example with the usual parentheses doesn't look any better than the messed up examples.
You are going to miss it when coding in other languages.
Here's an example:
*many years writing python spaghetti to accomplish personal tasks, just now trying to build an employable foundation..
[0] http://www.paulgraham.com/avg.html (referenced in the top link blog post)
The original linked article is a promotion for Julia with some decent criticisms of CL.
CL has a special place in my heart. I want to love it. I programmed in it, bought just about every book I could to learn about it, etc. But CL was just a huge time sink to do anything to me. Ignoring my (lack of) skill with it I found it was difficult to really find help (though the CL IRC channel is active and probably the nicest community in programming). Everything still felt strange to me 6 months in and even with other similarly good languages this usually doesn't occur. For example, with SBCL and Quicklisp it felt like even getting a database connection set up was pulling teeth.
I found the problem of having dozens of implementations hard to cope with as well. SBCL is a standard and it can be quick (sometimes as quick as C). But there's also Allegro, LispWorks, and several others. Each one of them has their own quirks you have to know. If I wanted to develop well on Windows you were pretty much siloed into LispWorks and the extremely high costs to use it. In fact, Allegro and LispWorks both make IDA Pro's pricing look reasonable and come close to rivaling some CAD software. Making SBCL work on Windows was kind of a pain but workable. But then you have to deal with the package managers like Quicklisp which are great...but so many extra steps to get stuff done. Finally, I found it extremely difficult to work with CL outside of Emacs (which I like a lot and am quite familiar) especially with my career forcing a choice between Sublime or Vscode.
I think CL should inspire similar languages. I fell in love with Clojure but dropped it because its community is dwindling. It's commercial uses have dwindled which made me sad. It also couldn't be compiled like other Lisps and lacked the "general purpose" feel to it (having chosen it's domain for concurrent programming I felt). I long for a popular, modernized lisp with all the benefits of the other lisps, except with a better package manager, a community united in a single direction, and lots of support.
"getting a database connection set up was pulling teeth." => https://lispcookbook.github.io/cl-cookbook/databases.html Use cl-dbi (connection layer) or Mito (light ORM) and do:
(mito:connect-toplevel :sqlite3 :database-name "myapp") ;; also mysql and postgres
"having dozens of implementations hard to cope with"
=> you don't have to cope with so many, or any at all. Use one implementation if it suits you well."develop well on Windows" => SBCL works fine as of today.
"extremely difficult to work with CL outside of Emacs" => solved or being solved. See the plugins for Vim, Atom, Sublime, VSCode, Jupyter, Geany… and more. Also Portacle (a portable Emacs for CL), the Lem editor, the free LispWorks IDE… https://lispcookbook.github.io/cl-cookbook/editor-support.ht...
"a better package manager" => Quicklisp is great (easy to use, easy smoothing) but with shortcomings. See CLPM, the Ultralisp distribution, Qlot.
"lots of support." there's room for anybody I guess: pro support (LispWorks, Allegro…), helpful community (reddit, Discord, pro mailing list…)
It's a perfectly good programming language, but nothing special.
You have REPL running, you can evaluate functions, and definitions on the fly, or completely re-define the function, even if said function is being called in a loop by other one, and it will work. Or, redefine classes, and it will be fine. Or, if function errors, debugger gets launched, and you have option to redefine variables, and the function will continue with that variable (if, you called undefined variable)
Though, I believe, its better to see how it works, rather than read, While the video is not mine, https://www.youtube.com/watch?v=6pMyhrDcMzw And remember, this is not hot reloading.
It is actually not about a "REPL" but "image-based" development. It is WAY ahead of the Python REPL, which was already a relief for me. The Python REPL is archaic in comparison.
There's probably a few different reasons to why but one thing that the 3 i've listed above all have in common is that they have image-based environments. So thats probably one of the top reasons why they have superior REPLs.