Most active commenters
  • iLemming(5)
  • tombert(4)

←back to thread

Hofstadter on Lisp (1983)

(gist.github.com)
372 points Eric_WVGG | 33 comments | | HN request time: 0.785s | source | bottom
1. 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 #
2. volltrottel ◴[] No.41860189[source]
Running hacker news
3. 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 #
4. 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 #
5. iLemming ◴[] No.41860409[source]
Some purist won't consider Clojure a "true" Lisp, but it's a Lisp dialect.

> what else is Lisp being used for commonly these days?

Anything that runs on Clojure - Cisco has their cybersec platform and tooling running on it; Walmart their receipt system; Apple - their payments (or something, not sure); Nubank's entire business runs on it; CircleCI; Embraer - I know uses Clojure for pipelines, not sure about CL, in general Common Lisp I think still quite used for aircraft design and CAD modeling; Grammarly - use both Common Lisp and Clojure; Many startups use Clojure and Clojurescript.

Fennel - Clojure-like language that compiles to Lua can handle anything Lua-based - people build games, use it to configure their Hammerspoon, AwesomeWM, MPV, Wez terminal and things-alike, even Neovim - it's almost weird how we're circling back - decades of arguing Emacs vs. Vim, and now getting Vim to embrace Lisp.

replies(2): >>41861671 #>>41862563 #
6. pfdietz ◴[] No.41860430{3}[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 #
7. casta ◴[] No.41860450[source]
The pricing engine for Google Flights (and behind many big airline websites) is written in Lisp.
8. mepian ◴[] No.41860590[source]
>what else is Lisp being used for commonly these days?

It is being used for formal verification in the semiconductor industry by companies like AMD, Arm, Intel, and IBM: https://www.cs.utexas.edu/~moore/acl2/

9. iLemming ◴[] No.41860605{4}[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 #
10. packetlost ◴[] No.41860737{4}[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
11. nextos ◴[] No.41860851[source]
> Why is most AI work done in Lisp?

Yann LeCun developed Lush, which is a Lisp for neural networks, during the early days of deep architectures. See https://yann.lecun.com/ex/downloads/index.html and https://lush.sourceforge.net. Things moved to Python after a brief period when Lua was also a serious contender. LeCun is not pleased with Python. I can't find his comments now, but he thinks Python is not an ideal solution. Hard to argue with that, as its mostly a thin wrapper over C/C++/FORTRAN that poses an obvious two-language problem.

replies(3): >>41861189 #>>41861684 #>>41862306 #
12. vnorilo ◴[] No.41861002{5}[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 #
13. sourcepluck ◴[] No.41861146[source]
I think personally that Coalton and the stuff its built on is crazy cool. Coalton is a little library you add to your Lisp, but, to quote the third link here: "In terms of its type system, Coalton’s closest cousin is Haskell." So Lisp's dynamism with all sorts of advanced typing.

QVM, a Quantum Virtual Machine https://github.com/quil-lang/qvm

Quilc, an "advanced optimizing compiler" for Quil https://github.com/quil-lang/quilc

Coalton, "a statically typed functional programming language built with Common Lisp." https://coalton-lang.github.io/20211010-introducing-coalton/

14. sourcepluck ◴[] No.41861189[source]
Hadn't seen that before, very interesting!
15. ryukafalz ◴[] No.41861256[source]
Guix is a Nix-like package manager and distro that is almost entirely written in Guile Scheme: https://guix.gnu.org/

I would guess it's by far the most active Guile project.

16. jjtheblunt ◴[] No.41861289[source]
Grammarly was famously using it.

https://www.grammarly.com/blog/engineering/running-lisp-in-p...

17. vindarel ◴[] No.41861317[source]
Quantum computing and symbolic AI? But also web services, CAD and 3D software, trading, designing programmable chips, big data analytics…

present companies (that we know about): https://github.com/azzamsa/awesome-lisp-companies/

18. iLemming ◴[] No.41861322{6}[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 #
19. tmtvl ◴[] No.41861331[source]
> what [...] is Lisp being used for [...] these days?

I dunno, there's Nyxt, Google Flights, MediKanren, there's some German HPC guys doing stuff with SBCL, Kandria,... I believe there's also a HFT guy using Lisp who's here on HN. LispWorks and Franz are also still trucking, so they prolly have clientele.

There are fewer great big FLOSS Lisp projects than C or Rust, but that doesn't really tell the whole story. Unfortunately proprietary and internal projects are less visible.

20. chromaton ◴[] No.41861541[source]
AutoCAD automation?
replies(1): >>41862161 #
21. ◴[] No.41861549[source]
22. tombert ◴[] No.41861671[source]
When I was there, Apple used Clojure for a lot of stuff involving the indexing of iTunes/Apple Music. I used it for some telemetry stuff on top of the indexer as well. Not sure what other teams used it for.
23. buescher ◴[] No.41861684[source]
A friend used lush as his “secret weapon” for a while. I didn’t quite warm to it and now regret not paying attention. It’s amazing how much is packed in “batteries included.”

Apparently it didn’t make the transition to 64-bit machines well? But I haven’t really looked.

24. fuzztester ◴[] No.41862161[source]
Yes. AutoLisp was available from the early days of AutoCAD. I didn't use it much myself. I just helped some mechanical engineers with it in a company where I worked, in small ways, just tinkering, really. At that time I was quite junior, so I didn't really grasp the power of it, so I didn't play around with it much.
25. shawn_w ◴[] No.41862306[source]
It's just as easy to have thin wrappers over C/etc. number crunching libraries in Common Lisp as it is Python. And pure CL code is typically faster than pure Python (though pypy might be a different story). There's no technical reason it still couldn't be dominant in AI.

It's a shame things took the course they did with preferred languages.

replies(1): >>41866513 #
26. SSLy ◴[] No.41862563[source]
Google Flights was built on CL, no?
27. mportela ◴[] No.41866513{3}[source]
My take is that Python won by having a complete ecosystem centralizing many tools that were dispersed in different languages: - Numpy/Scipy/Matplotlib enabled scientists to do data analysis with Panda similar to what was available in R - PySpark enabled big data scripts in Python instead of Scala - PyTorch made Torch available for non-Lua users

Bit by bit, more people got used to doing data analysis and AI research in Python. Some projects were even written for Python first (e.g. Tensorflow or Keras). Eventually, Python had so many high-quality packages that it became the de facto for modern AI.

Is it the _best_ language for AI, though? I doubt. However, it is good enough for most use cases.

28. knbknb ◴[] No.41866917[source]
Some computer science departments (and their MOOCs) use Lisp Dialects "Racket" and "Scheme" as a Teaching Language . For example, IDE DrRacket has an innovative language preselection feature that allows students to start out with a "Beginning Student Language".

https://www.racket-lang.org/

29. lanstin ◴[] No.41870542{6}[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.

30. tombert ◴[] No.41870568{7}[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 #
31. iLemming ◴[] No.41870825{8}[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 #
32. tombert ◴[] No.41871664{9}[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 #
33. iLemming ◴[] No.41872934{10}[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