5 ms·
How does it compare to Rust? What do you like about each?
by CodeSgt 4y ago
How does it compare to Rust? What do you like about each?
- ChadNauseam 4y agoThe garbage collector is nice because sometimes you don't want to think about memory management or the borrow checker. The syntax is really cool, it looks like python but it's completely whitespace insensitive. The module system is neat, and I actually like writing module interfaces (which are basically analogous to header files in C/C++). It makes dependency injection trivial, because you can have a module say "I depend on a module with this interface, but the caller can choose which one", which is more useful than it sounds. It's also a functional language, so you have very little mutability, and it supports """monads""" with its super innovative "monadic let" syntax. (It's basically like overloading the semicolon, which probably doesn't make any sense, but it's really cool.) Dune is a very pleasant build system and Esy is a very pleasant package manager. The language server is good. I'd say in this dimension it's competitive with Rust. There's really quite a lot to like about OCaml. My biggest gripe with it is no typeclasses/traits. But I have hope that modular implicits will land within our lifetimes.
- tgflynn 4y agoWhat exactly is Esy ? I hadn't heard of it before and its website doesn't seem to provide an obvious answer to that question. You say it is a package manager. Is it supposed to replace opam ? If so what does it offer that opam doesn't ?
- pdimitar 4y agoIt's like Rust's cargo or Elixir's mix. A task runner, mostly.
- ChadNauseam 4y agoIt's a package manager that replaces Opam. It doesn't require switches and it caches builds of packages across projects.
- UncleOxidant 4y ago> The syntax is really cool, it looks like python I'm squinting really hard but not seeing the resemblance.
- ChadNauseam 4y agoI said that because there's no curly braces and you don't usually have to use semicolons
- throwamon 4y ago> you don't usually have to use semicolons That's compensated by the use of double semicolons :O)
- ChadNauseam 4y agoHa! That's only in the REPL, which I never use