News for hackers. Stuff that matters.
Re:Rust-style resource management in OCaml by catnaroek on Friday March 16, 2018 @07:42AM (#16599965)
Algebraic data types and ML-style modules are non-negotiable.
Re:Rust-style resource management in OCaml by pjmlp on Friday March 16, 2018 @08:20AM (#16600100)
In Ada, you can get similar concepts via tagged records and generic packages.
Re:Rust-style resource management in OCaml by catnaroek on Friday March 16, 2018 @08:28AM (#16600152)
Tagged records are one possible in-memory representation of sum values, perhaps the most sensible one. But I don't want in-memory representations of sum values. I want sum values themselves.

ML modules are much more than generic packages. ML's module system allows you to take an existing module, hide some of its components, make some of its concrete types abstract, and get a new module. My methodology of enforcing only one invariant in each module is impracticable without ML modules.