Top
Best
New

Posted by elvis70 18 hours ago

Learn Programming with OCaml(usr.lmf.cnrs.fr)
255 points | 93 commentspage 2
shevy-java 11 hours ago|
I know a few programs written in OCaml such as weidu.

OCaml is a very strange programming language. I don't think it will be able to sustain e. g. success stories of other languages, such as python.

debo_ 11 hours ago|
Ocaml is ancient at this point. It's never going to be python, but I doubt it's going to disappear.
htl 10 hours ago||
[dead]
lngnmn2 7 hours ago||
[dead]
giraffe_lady 15 hours ago|
OCaml is the LLM secret weapon right now. They are better at writing it than they are any other language.* That’s all I have to say about it.

* Other “pure” hindley-milner languages are tied but among them ocaml has some particular strengths that I’m sure others will discuss.

nine_k 14 hours ago||
Two genuine questions. (1) Why not Rust? (2) Why not Haskell?

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

yawaramin 13 hours ago|||
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.

giraffe_lady 14 hours ago||||
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.

throwrioawfo 14 hours ago|||
(1) complexity

(2) performance

mchaver 11 hours ago|||
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.
steve1977 14 hours ago|||
Did you also compare F#?
sroerick 11 hours ago|||
Couldn't agree more. Even when the models could barely write it, the compiler was so good
phtrivier 14 hours ago||
Flamebait aside, has this been studied for real ? Curious how you would rate that...
giraffe_lady 14 hours ago||
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.
rybosome 8 hours ago|||
Can it not be studied with open weight models? This is a genuinely curious question, not an attempt at scoring a point.
yawaramin 13 hours ago|||
I'd be very interested to read this paper when it comes out.
giraffe_lady 13 hours ago||
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.

Fiodel 13 hours ago||
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"
giraffe_lady 12 hours ago||
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.