5 ms·
If you took SML and removed reference cells and the parts of the standard library that involve IO, then you'd have a pure language (depending on whether you con
by Athas 5y ago
If you took SML and removed reference cells and the parts of the standard library that involve IO, then you'd have a pure language (depending on whether you consider exceptions to be effects). It would not be useful for application programming, but would be fine for teaching functional programming.
- Zababa 5y agoThat's true. I think it also ties into best practices such as hexagonal architecture, DDD, and the "functional core, imperative shell" idea. You design the core of your program as data and pure functions, and then call that part from parts of the program that use IO. Maybe something like when scheme is used for teaching could work, with different "language levels", where some part disallow IO and reference cells. Or maybe a different file extension that's checked by the compiler to be pure. This could be a great way to teach functional programming but also software engineering.
- hcarvalhoalves 5y agoThe Hope language would be a educational SML w/o side-effects. https://en.wikipedia.org/wiki/Hope_(programming_language) https://en.wikipedia.org/wiki/Hope_(programming_language)