←back to thread

Hofstadter on Lisp (1983)

(gist.github.com)
372 points Eric_WVGG | 10 comments | | HN request time: 1.876s | source | bottom
Show context
dahart ◴[] No.41860159[source]
> Why is most AI work done in Lisp?

That’s changed, of course, but it remained true for at least another 15 or 20 years after this article was written and then changed rather quickly, perhaps cemented with deep neural networks and GPUs.

Other than running the emacs ecosystem, what else is Lisp being used for commonly these days?

replies(14): >>41860189 #>>41860283 #>>41860409 #>>41860450 #>>41860590 #>>41860851 #>>41861146 #>>41861256 #>>41861289 #>>41861317 #>>41861331 #>>41861541 #>>41861549 #>>41866917 #
tombert ◴[] No.41860283[source]
Can't speak for the entire industry obviously, but at a few jobs I've had [1] Clojure is used pretty liberally for network-heavy stuff, largely because it's JVM and core.async is pretty handy for handling concurrency.

I know a lot of people classify "Clojure" and "Lisp" in different categories, but I'm not 100% sure why.

[1] Usual disclaimer: It's not hard to find my job history, I don't hide it, but I politely ask that you don't post it here.

replies(1): >>41860365 #
packetlost ◴[] No.41860365[source]
> I know a lot of people classify "Clojure" and "Lisp" in different categories, but I'm not 100% sure why

It mostly boils down to Clojure not having CONS cells. I feel like this distinction is arbitrary because the interesting aspect of Lisps is not the fact that linked-lists are the core data-structure (linked-lists mostly suck on modern hardware), but rather that the code itself is a tree of lists that enables the code to be homoiconic.

replies(1): >>41860430 #
1. pfdietz ◴[] No.41860430[source]
I mean, you can have a tree of vectors also, so I don't see why lists are needed for homoiconicity.
replies(2): >>41860605 #>>41860737 #
2. iLemming ◴[] No.41860605[source]
No, not needed. This argumentation can go both ways; some may even say, "Well, Python is 'Lispy,'" which to me is obviously not. It boils down to what can you do in the REPL, right? https://news.ycombinator.com/item?id=41844611
replies(1): >>41861002 #
3. packetlost ◴[] No.41860737[source]
That's mostly my point. A linked-list structure is not the interesting part. I use the "generic" reading of list above and don't mean to imply some particular implementation
4. vnorilo ◴[] No.41861002[source]
In my mind Clojure is Lispy, Python is not, nor is Javascript.

In addition to REPL and macros, I think two other Lispy features are essential:

nil is not just the sad path poison value that makes everything explode: lisp is written so that optionals compose well.

Speaking of composing, Lisps tend to be amazing with regard to composability. This is another line that cuts between CL, Scheme and Clojure on one side, with Python and Javascript firmly on the other side in my experience.

Lisps are as dynamic a languages ever go, unapologetically.

replies(2): >>41861322 #>>41870542 #
5. iLemming ◴[] No.41861322{3}[source]
I just wanted to add that "dynamic" doesn't mean untyped or weakly typed. Clojure is a strongly-typed dynamicly-typed PL. Clojurescript compiler for example, in many cases can produce safer JS code than even Typescript ever could.
replies(1): >>41870568 #
6. lanstin ◴[] No.41870542{3}[source]
Having read Let over Lambda, I would say I find Javascript to be (a superset of?) a lispy language. If functional values with lexical binding are supported, then you get all the power of The Little Lisper.

Perhaps the macro facilities are also convenient but that is not the part that makes Lisp mathematical, it's the higher order programming.

And it needn't even be something fancy, just being able to have a data table of tests and have the test functions generated and executed from the table is the power demonstrated.

7. tombert ◴[] No.41870568{4}[source]
Out of curiosity, can you give an example of where ClojureScript is safer than TypeScript? I'm pretty far removed from the frontend world so this sounds pretty interesting to me.
replies(1): >>41870825 #
8. iLemming ◴[] No.41870825{5}[source]
This is a slightly expanded answer to your question, apologies for the external link, I could of course repeat here verbatim, but let's not increase entropy needlessly, right? https://www.reddit.com/r/Clojure/comments/1dyjwyo/is_it_easi...

Beware though, that there are today more than one flavor of Clojurescript, nbb for instance still acts just like JS in this regard.

replies(1): >>41871664 #
9. tombert ◴[] No.41871664{6}[source]
This is exactly what I wanted...thanks!

The last time I did ClojureScript in serious capacity was for a school project in 2021, specifically because I wanted to play with re-frame and the people who designed the project made the mistake of saying I could use "whatever language I want".

It makes sense, but I guess I didn't realize that ClojureScript generates some nice runtime wrappers to ensure correctness (or to at least minimize incorrectness).

I guess that means that if you need to do any kind of CPU-intensive stuff, ClojureScript will be a bit slower than TypeScript or JavaScript, right? In your example, you're adding an extra "if" statement to do the type check. Not that it's a good idea to use JS or TypeScript for anything CPU-heavy anyway...

replies(1): >>41872934 #
10. iLemming ◴[] No.41872934{7}[source]
> ClojureScript will be a bit slower than TypeScript or JavaScript, right?

In rare cases, sure, it can add some overhead, and might not be suitable I dunno for game engines, etc., but in most use-cases it's absolutely negligible and brings enormous advantages otherwise.

Besides, there are some types of applications that simply really difficult to build with more "traditional" approach, watch this talk, I promise, it's some jaw-dropping stuff:

SpreadSheesh! talk by Dennis Heihoff https://www.youtube.com/watch?v=nEt06LLQaBY