Thanks for this article — this is the kind of voice that speaks to most readers. On the other hand, if you want to punish yourself with too much theory: A few years ago I wrote about the same topic of modular data abstraction but took an approach that tried to dig deep in to the data abstraction theory from the PLT side and explained the theoretically pure version of abstraction and then tried to implement it in a bunch of languages (including Rust and OCaml): https://www.bkase.io/posts/data-abstraction
Ultimately, knowing how to use data abstraction in your language of choice is important in the short term, but understanding and naming the general concepts equips you to understand these tools as our languages evolve and change.
This is a very good article, and I recommend reading it but as a mathematician its title rubs me the wrong way. You can’t encode ML-style modules in Rust, and the article acknowledges that. The title of the article is factually false and basically clickbait. To encode ML-style modules you need dependent types.
This is all a shame because the body of the article is very good.
Yeah, I don’t know how I forgot that[0], since I think I previously mentioned it myself on this very site. Though recursive modules still require an extension[1].
But even so, the point still stands. ML modules are not encodable in Rust.
Personally, I think the title should be understood to be existentially- rather than universally-qualified. If the title were “Cooking pasta in a pot”, you would probably assume it covers at least the main methods of cooking, but probably not every possible method.
Thanks for this article — this is the kind of voice that speaks to most readers. On the other hand, if you want to punish yourself with too much theory: A few years ago I wrote about the same topic of modular data abstraction but took an approach that tried to dig deep in to the data abstraction theory from the PLT side and explained the theoretically pure version of abstraction and then tried to implement it in a bunch of languages (including Rust and OCaml): https://www.bkase.io/posts/data-abstraction
Ultimately, knowing how to use data abstraction in your language of choice is important in the short term, but understanding and naming the general concepts equips you to understand these tools as our languages evolve and change.
Please post as a separate story, I’d like to upvote :)
https://lobste.rs/s/talogd/data_abstraction_theory_practice_2020 Done 🙂
This is a very good article, and I recommend reading it but as a mathematician its title rubs me the wrong way. You can’t encode ML-style modules in Rust, and the article acknowledges that. The title of the article is factually false and basically clickbait. To encode ML-style modules you need dependent types.
This is all a shame because the body of the article is very good.
Rossberg et. al. have shown that System Fω is enough.
Yeah, I don’t know how I forgot that[0], since I think I previously mentioned it myself on this very site. Though recursive modules still require an extension[1].
But even so, the point still stands. ML modules are not encodable in Rust.
[0] https://people.mpi-sws.org/~rossberg/f-ing/
[1] https://people.mpi-sws.org/~rossberg/mixml/
What would you prefer the article be titled?
Personally, I think the title should be understood to be existentially- rather than universally-qualified. If the title were “Cooking pasta in a pot”, you would probably assume it covers at least the main methods of cooking, but probably not every possible method.
(Looking it up now to make sure the analogy makes sense, it seems that there are indeed multiple non-mainstream variations of cooking pasta, such as with less water and not achieving a boil.)