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

Expression-based, immutable by default, pattern matching, static typing, and result / option types are the mix of features that make Rust what it is at its core, and each of those you'll find in OCaml. There's a couple others but that's the heart of it.

I'm not saying that Rust feels like Ocaml as some are interpreting, I said Rust is more imperative feeling, they're not the same. The reason Rust has had success bringing these features to the mainstream where Ocaml has not, I believe, is because Rust does not describe itself as a functional language, where as Ocaml does, right up front. Therefore, despite Rust having a reputation for being difficult, new learners are less intimidated by it than something calling itself "functional". I see it all the time. By the time they learn Rust, they are ready to take on a language like Ocaml, because they've already learned some of the best parts of that language via Rust.

Note my comment about their similarities is not at the level of borrow checkers and garbage collectors.





Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: