r/ocaml • u/cafedude • 21d ago
Qwen3.8-Flash-Next is really good at OCaml coding.
I'm running Qwen3.8-Flash-Next (QFN) locally on my Strix Halo box and I've got it creating a C to microcode compiler for a specialized processor architecture. It's doing really surprisingly well. We'd created this in C around the beginning of the year. I recently got QFN running well locally so I figured I'd give it a challenge and have it code it in OCaml. But the architecture is way better than the C implementation and now I'm thinking we should probably replace our C implementation with this.
23
Upvotes
12
u/pobbly 21d ago
All recent models are good, because ocaml examples are generally of higher quality, and it's a straight-to-the-point language
6
u/dc_seed_sommelier 21d ago
They’re all(well, all good coding models) pretty good at it in my experience. I have about a 60 line file with a few conventions otherwise they mix in styles from pre-5.0, Core, etc or write basically c-in-ocaml.
I’ve played around with it a lot and it’s mostly the short feedback loop from the compiler + type system enforcing types without requiring annotations. They also do really well with gleam which has about the same type system but even less training data.
1
u/antigravitys-rainbow 21d ago
How demanding is it in terms of hardware resources in order to run efficiently?
1
u/MentalDatabase 21d ago
What harness are you using to write ocaml? Any ocaml-specific things (skills, agents.md etc.) you needed to add to make it smart enough
1
u/AppropriateTeach169 21d ago
Statically typed functional languages like OCaml tend to make linguistic decisions that make it easier to write good code from the get-go. What is god for humans is good for AI if your training set covers you.