Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In what ways is Rust more pragmatic than OCaml?


Does not really require you to drop to a lower-level language for performance, unless you really need to use assembly for something.

OCaml is great for the application level stuff, and also performs quite well in general. But for building fundamental parts of the stack in which perf is important (like the multi-threading runtime, the garbage collector, etc.) you need to drop down to C++, C, or Rust.

OCaml is definitely much nicer to use than C and C++. But I don't find it that much nicer to use than Rust TBH.


> OCaml is definitely much nicer to use than C and C++. But I don't find it that much nicer to use than Rust TBH.

I find OCaml quite a bit nicer to use than Rust, though in a lot of ways that's due to my preference for structuring code using modules and functors.

However, due to Cargo and the fact that Rust has good Windows support, I end up reaching for Rust much more often than I do for OCaml.


Modules is pretty much the only OCaml feature I miss in Rust. I can work around functors with some effort in Rust, and hopefully GATs will make this even simpler (although I don't expect GATs to give Rust functors).


A good package manager, multicore support, larger community, and so on.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: