upvote
Two genuine questions. (1) Why not Rust? (2) Why not Haskell?

(I have my own answers, but I'd love to hear yours, too.)

reply
1. Compile times. OCaml compiles very quickly (think Go) and this gives you a fast feedback loop. It lets the LLM rip through the implementation.

2. OCaml has an idiomatic approach of using interface files for all modules that can be accessed outside their libraries, and interface files give LLMs a great précis of exactly what is wanted. They then just have to follow the types and fill in the blanks to get the implementation. It's nearly the perfect use case.

reply
Both force the model to reason about types too much. The more constrained type system plus global inference merely holds them to what they already wrote, with very fast feedback.

Rust is fine if you need it but most things don’t and ocaml has more convenient abstractions for “regular” work. If you need rust you need rust but ocaml isn’t that far off in perf.

Haskell type system is too expressive, it itself becomes a place for the agent to make mistakes and get bogged down.

reply
(1) complexity

(2) performance

reply
For web frontend, it's derivative programming language, rescript, is also a secret weapon because of types, fast compilation times and first class support of React. Using React in rescript is much nicer than TypeScript.
reply
Did you also compare F#?
reply
Couldn't agree more. Even when the models could barely write it, the compiler was so good
reply
Flamebait aside, has this been studied for real ? Curious how you would rate that...
reply
Yes I contributed code to a paper on it this spring. It’s hard to measure and “studying” it just means feeding money into frontier models. If anyone has a few billion tokens for a couple masters students hmu so they can get it published.
reply
Can it not be studied with open weight models? This is a genuinely curious question, not an attempt at scoring a point.
reply
I'd be very interested to read this paper when it comes out.
reply
I will add you to the list, I’ll definitely post it on HN also.

They had originally planned on june and my part is in so…. Me too.

reply
I'm interested too - besides the paper, is it your personal experience that working with llms on ocaml is superior to other languages? I thought with the sheer amount of training data languages like python and java would be "ideal"
reply
No it’s more about speed and quality of the feedback loop. So you want the compiler that catches the most stuff when given the least information.
reply