127 points · by mgrayson · 3y ago · 114 comments
Edit: I’m wrong in the present case! Author has some cool projects on GitHub under themetaschemer. Still though I’m struck by the ratio of lisp project articles vs lisp praising articles hitting HN’s front page.
HN articles about exotic things, not just Lisp, do seem to get upvoted disproportionately.
Also, PG declared Lisp as something you're supposed to think is important or a superpower, and I've wondered whether that also contributes to some upvotes on HN.
But I'm not aware that a single one of the bajillion YC startups used Lisp.
Maybe it's like an admirable religious dogma that a congregation affirms each weekend, and then promptly forgets about for the rest of the week.
I have received offers this year to join well-funded startups using Clojure.
Datomic is great for some usecases. Clojure often leads the Stack Overflow survey in terms of salary.
Clojure often leads the Stack Overflow survey in terms of salary.
wouldn't that also imply the classic demand and supply thingy ? the one that is alluded too in pg's articles...they switched to python for various reasons.
From the outside my code bases look 0% lisp, from the inside they are 100% lisp with build artifacts in other languages.
Is Rust brain dead language anyone can follow along? Did you mean python?
> From the outside my code bases look 0% lisp, from the inside they are 100% lisp with build artifacts in other languages.
Can you expand on that? You generate code of other language than lisp in lisp?
I never bothered checking it out before because I had always seen it described as unusable so I figured it would be a waste of time.
After much searching for the perfect languages and perfect tools (while using emacs as a simple text editor), it finally dawned on me that Emacs itself is as close as I'd get to a lisp machine right here in my own back yard. A lisp machine that sits quite nicely on top of linux/unix and plays very nicely with it.
There's much that I love about the lisp world, and the author does a great job of articulating the reasons why. There's also much that I love about the unix philosophy. Emacs is a bridge between these two worlds that I love, and I'm old enough now not to give a shit (or need to give a shit) what the rest of the world is doing. This is home.
What's the lesson? That a text editor's extension language needs the strong concurrency and immutability models of a Clojure or sbcl? Getting emacs to sit and roll over doesn't exactly require an industrial grade language.
Do you mean since hitting rock bottom in June 2021?
https://pageviews.wmcloud.org/?project=en.wikipedia.org&plat...
As such, it damn near was a superpower compared to everything else available at the time in about 1984--think Assembly, C, Pascal, etc. Garbage collection meant that all the effort everybody else spent on memory management could be spent on your problem. And the ecosystem meant that you had actual data structures to work with right in the language library instead of having to build those from scratch every time.
Emphasis on WAS. Right at about 1988, the new languages demonstrated that everybody got the message.
Perl, Tcl, Python, etc. all had garbage collection and worked very hard to create a general ecosystem. This roughly negated the advantages that Lisp had.
At that point, anybody really well versed in Perl, Tcl, Python, etc. was equally as productive as if they were writing in a Lisp.
I'm happy to hear more thoughts and notes like this from the silent majority.
I’d love to write more lisp, and like the article author I’m drawn to Racket, but I’ve just got very little bandwidth for exploring it further. Even so, lisp generally is something I advocate learning especially to mentees, because learning it (in author’s sense pretty much exactly as expressed, but with no strong feelings towards static typing at the time) was so transformative for me. I don’t need to write lisp to reap most of its benefits now… I write code in whatever language with the same attitude the author describes: mostly operate on values, abstract and isolate mutations with particularly high value, enjoy reasoning about code easily. And I’d add: recognize things which are like sexprs for what they are as things you can treat like sexprs because that’s more or less what they are.
Granted I’m not posting anything to HN, front page or otherwise besides comments. But I’m still inclined to praise lisp even a few years out from the last time I actually wrote any. Because it’s bound to be as foundational for others as it has been for me.
The tricks my muscle memory does on its own accord with lisp syntax within Emacs makes programming more fun than any other context.
Maybe I am missing something but I visited their GitHub but could not find any cool projects. Clearly there are better examples of people who write Lisp seriously instead of evangelizing it. You have given some good examples of them yourself.
All those Rust posts you're talking about on HN? They're annoying.
Eg https://knowledge.autodesk.com/support/autocad/learn-explore...
With Racket?
File through the Elite source code. Do tut.txt in Arc.
Picture ten billion things and ChatGPT-X, Lisp interacting.
https://docs.racket-lang.org/reference/index.html
I would think that it has roughly 4000 identifiers in the Racket language.
See the index: https://docs.racket-lang.org/reference/doc-index.html
Common Lisp has <1000 exported symbols in the "COMMON-LISP" package.
> when Common Lisp was being planned they needed to accomodate many features from many different Lisps before it
Common Lisp is mainly a slightly modernized & portable version of Lisp Machine Lisp, the feature influence of other Lisp dialects is not that big. The main difference is that Common Lisp provides lexical bindings and lacks a few features.
If you're looking to create a stand-alone executable and have C/C++ libraries you'd like to use then SBCL or Racket may be more useful to you.
I started with Common Lisp and PG's online book On Lisp. http://www.paulgraham.com/onlisp.html
Type checking can remove an entire class of bugs from even being a consideration. Yes, it could be argued that type mismatches are a trivial class of bug, and yes, proper testing should catch any issues... but catching problems before you go to testing can save you precious seconds, especially when coding in the typical interactive style of Lisp. Lisp lets you code at amazingly high velocity, good support for type checking helps increase that velocity even further.
Isn't making sure the types flowing in and out of your functions match, at some point, something you will eventually need to do anyway? Or are we trying to say the type system doesn't allow for perfectly safe things that should be allowed?
I'm not sure I understand it.
Then again, I'm also the person who wonders if the restrictions Rust puts on "valid" code aren't also too restrictive, so maybe we all exist on a gradient?
Just because keywords and symbols exist doesn't mean the hypothetical programmer who would return -1 as a special value in a static language will not do so in a dynamic language. But in the statical language when the sum type is used it will prevent people from passing the result into an arithmetic function when more code is added in the future (in an ideal world tests would catch it, but in an ideal world the sum type would have been used from the very beginning).
There are trade-offs between static and dynamic typing, and while dynamic typing allows us to write code more quickly, things balance out when we include the time lost by type matching errors that static type would protect us from.
It's like the C vs Rust discussion but with less potential for leaking important customer data all over the web.
While you are discovering the correct way to solve a problem, you may desire to make such changes.
Therefore types can make it harder to discover the correct solution.
For example, if our customer IDs used to simply be increasing integers but then we decide to change to a UUID variant it would be a pain if I had something like:
(declaim (ftype (function (integer) (option customer)) get-customer-by-id))
And then had a bunch of functions calling out to that which all require integers and I had to change all the declarations from integer to UUID. However, I could save myself some future headaches by doing something like: (deftype customer-id nil 'integer)
And using the customer-id type everywhere. Of course, this is a very trivial example and a real problem would be harder to manage. That said, with optional type checking like SBCL has it is entirely possible to fly by the seat of your pants until things start to take shape.Not that it matters too much if you go with the tried and true method of tossing out the first two prototypes, but that's another discussion.
The older I get the more I realize that what makes something great to use isn't all about the language, but the surrounding environment, and how pleasant _that_ is to use. Personally I think I will most likely not Lisp for much longer because I'm seeing many other languages have much nicer to use ecosystems, even if they probably pay less.
Rust OTOH feels highly malleable and the tooling is always improving. The community seems to care about a good user experience across several domains - web, systems, networking, cryptography, desktop gui, and over the last 2 - 3 things are really coming together as coherent whole.
In other languages I hop around from class defs to class defs, different files. Just richocheting all over the file system. Something about LISP removes a lot of the ricochet. It's a weird sensation.
But I don't use it outside of Scripting .NET Apps anymore other than when needing to perform quick calculations while I'm already in the command-line, I can bring up a quick LISP REPL with `x lisp`.
[1] https://sharpscript.net/lisp/
I sort of feel like I'm walking through an abandoned alien city and wondering what size they were, how many limbs they had, and if we share the same 5 senses or not.
- Use an array
- Load the entire file in a memory buffer and skip the reader
- Use mmap (for extra points, you can keep the entire file outside the Lisp heap but still manipulate it in Lisp)
But, also, once you hit a couple megabytes or so, it’s almost always better IMO to consume a file incrementally rather than all at once.