r/functionalprogramming • • Jul 08 '25

Question why not Lisp/Haskell used for MachineLearning/AI

i have a course on topic of AI: Search Methods and it the instructor told about Lisp, found out it was a func-lang, also told about functions like car & cdr why in the real world of AI/ML func-langs aren't adopted more when they naturally transfom to operations like, map->filter->reduce->functions

am I missing something ?

56 Upvotes

66 comments sorted by

View all comments

Show parent comment

3

u/funbike Jul 12 '25 edited Jul 12 '25

FYI, waaaay back in the late '90s I attempted to build a large product with Java/ESC, now OpenJML, which extended Java with design-by-contract annotations in comments (pre/post conditions and invariants).

Java/ESC converted code and contracts into a format that could be fed into the Simplify theorem prover. It found lots of real bugs, many of which were missed by code review and unit testing. (However, some were because java didn't yet have generics or an optional type).

One great thing is that it didn't require a PhD in computer science to use. You just coded in standard Java with some additional boolean checks.

In the end my effort failed. They didn't keep up with changes to Java, as they had written their own parser, rather than using an AST from a highly supported one. Also, I felt their tool lacked some practical ergonomics that would have made it less of a pain to use. The biggest one would be a way to specify if a contract should be enforced during compile time or runtime.

I never forgot how effective that tool was. Now that this AI explosion is happening, I can see how it could be used to assist LLMs at creating correct code.