3 ms·
Hide memory management under a language runtime. Make a single Fn trait/string type instead of multiple ones. Add effect polymorphism to deal with function colo
by Hirrolot 4y ago
Hide memory management under a language runtime. Make a single Fn trait/string type instead of multiple ones. Add effect polymorphism to deal with function colours. Remove async/.await and express it using algebraic effects, do the same for streams and iterators.
How it'd be designed and implemented is probably a theme for a separate blog post, not a HN comment.
- pjmlp 4y agoSo basically OCaml.
- jules 4y agoOCaml is great, but it lacks traits / type classes. That plus some syntactic tweaks would make OCaml amazing for most general purpose programming.
- pjmlp 4y agoThat is what functors and modules are for. And then the O in OCaml is all about OOP.
- jules 4y agoFunctors and modules are nice but do not have the convenience of traits and type classes. The problem with functors and modules is that you have to manually instantiate the right functors and modules when you want to use some operation. Type classes and traits build the right instantiations for you based on the types. I want to write `toString (1,true)` not `ToStringPair(ToStringInt)(ToStringBool).toString (1,true)`.