3 ms·
The reason why Ocaml and Haskell are relatively verbose is that in order to achieve maximum performance one must write code in a decidedly unidiomatic style.
by smabie 7y ago
The reason why Ocaml and Haskell are relatively verbose is that in order to achieve maximum performance one must write code in a decidedly unidiomatic style.
- rwmj 7y agoThis is true, but also not necessarily an objection. It gives you a choice of decent performance by default, or very good performance when you really need it.
- k__ 7y agoReminds me of some blogposts abut JavaScript and Rust, I've read. The author was arguing that you can achieve maximum performance with Rust while still writing it in an idiomatic way, which isn't possible with JS.
- tomp 7y agoThat might be true, but the converse is that even idiomatic Rust is extremely verbose and painful to the eyes. Ideally, you'd be able to write mostly OCaml (higher level, closures, polymorphism, GC) and Rust (safe manual memory management) only when needed.
- k__ 7y agoI think coming from JavaScript, the wins in writing Rust are much bigger than coming from OCaml. So, as a JavaScript developer, I currently favor Rust instead of OCaml.
- pjmlp 7y agoWhich will be possible when algebraic types get integrated into OCaml, part of the work has already been integrated due to the ongoing multi-core changes.
- tomp 7y agoYou mean algebraic effects? Can you link to more about how the specifically enable better memory management? I always though that would require linear types (at least Rust-like memory management - I see how effects would enable memory-pool / stack-like memory management).
- pjmlp 7y agoYes, sorry about the error. Here are some papers about it, https://github.com/ocaml-multicore/ocaml-multicore/wiki https://github.com/ocaml-multicore/ocaml-multicore/wiki https://github.com/ocamllabs/ocaml-effects-tutorial https://github.com/ocamllabs/ocaml-effects-tutorial
- tomp 7y agoI can't find any details on memory management (except regarding multicore GC, which is not user-facing changes AFAIK).
- yawaramin 6y agoIt's already possible, there's https://github.com/zshipko/ocaml-rs https://github.com/zshipko/ocaml-rs