3 ms·
ML with a borrow checker is a bit of an oxymoron though. Because proper closures (the kind Rust can't do) are essential for the classic functional programming t
by whateveracct 3y ago
ML with a borrow checker is a bit of an oxymoron though. Because proper closures (the kind Rust can't do) are essential for the classic functional programming that ML represents.
- chmod600 3y agoCan you explain "proper closures"?
- bobbylarrybobby 3y agoI would hazard that this means closures that can capture (shared) state. In Rust, a closure’s data must either be moved into the closure or outlive the closure (dangling pointers etc etc). In most other languages, GC allows closures to keep a handle to any data at all.
- zozbot234 3y agoIf you want a closure to outlive the outside bindings of its captures and thus have shared control over their lifecycle (which is the default behavior of closures in most FP languages) you can easily use Rc<> or Arc<> to that effect. Rust just forces you to be explicit about it.
- whateveracct 3y agoExactly - sharing is the core of FP
- iopq 3y agoML does garbage collection, if it didn't need it it wouldn't do it.
- pjmlp 3y agoNope, that is what an ML with linear types does.
- ReleaseCandidat 3y agoJane Street just entered the room: https://blog.janestreet.com/oxidizing-ocaml-locality/ https://blog.janestreet.com/oxidizing-ocaml-locality/ This part specially about closures: https://blog.janestreet.com/oxidizing-ocaml-ownership/ https://blog.janestreet.com/oxidizing-ocaml-ownership/ https://blog.janestreet.com/oxidizing-ocaml-parallelism/ https://blog.janestreet.com/oxidizing-ocaml-parallelism/ And yes, their changes introduce quite some additional syntax.