4 ms·
Surprised it's not OCaml; they've invested highly in OCaml.
by azangru 7y ago
Surprised it's not OCaml; they've invested highly in OCaml.
- dymk 7y agoIn their frontend, yes. The Flow JS typechecker, and (kind of) Reason. Backend and infrastructure sees more Rust though. Eg the Mercurial server implementation.
- vijaybritto 7y agoThe primary reason they stated is memory safety as this is gonna be really critical stuff dealing with money. Also no GC.
- tomp 7y agoOCaml is more memory safe than Rust (as the "unsafe" parts are harder to access). But it does have GC, so GC is likely the primary reason.
- gfs 7y agoI wouldn't label Rust as being less safe than OCaml. You have to explicitly opt-in to any unsafe operations. More often than not, the unsafe blocks are needed because the compiler can not check all of the invariant cases.
- saagarjha 7y agoDoes OCaml even have a way of shedding memory safety?
- ncmncm 7y agoOCaml is an "obligate-GC" language. Most languages that offer optional GC, including Rust (with its RC and ARC boxing) and C++ (with std::shared_ptr), implement it mainly via reference-counting.
- tomp 7y agoYes, the `Unsafe` module (well, at least used to have it... fairly undocumented... maybe it's been removed?).
- tomp 7y agoOops, I misremembered the name. @pcwalton is right, it's called `Obj`.
- pcwalton 7y agoSure. Obj.magic is a bit cast.
- ori_b 7y ago> You have to explicitly opt-in to any unsafe operations Many of the unsafe operations don't exist in OCaml. Often because the GC makes them unnecessary.
- pcwalton 7y agoYou can implement all of the unsafe operations in OCaml using the unsafe Obj.magic cast: http://caml.inria.fr/pub/docs/manual-ocaml/libref/Obj.html http://caml.inria.fr/pub/docs/manual-ocaml/libref/Obj.html
- pcwalton 7y agoI mean, you can just use #[forbid(unsafe_code)] if you really want to. You do have to audit your dependencies, but that's true with OCaml as well (call Obj.magic and all bets are off).
- deleted 7y ago[deleted]
- anp 7y agoHow’s the OCaml multi core rollout going these days? IIRC shared memory parallelism requires FFI still.
- jsgf 7y agoLess so these days: https://github.com/facebook/hhvm/tree/master/hphp/hack/src/parser https://github.com/facebook/hhvm/tree/master/hphp/hack/src/p...