47 ms·
Note that I didn't say that lazy evaluation is needed for functional programming. I said that Rust doesn't have lazy evaluation, and that it's not a functional
by yawaramin 5y ago
Note that I didn't say that lazy evaluation is needed for functional programming. I said that Rust doesn't have lazy evaluation, and that it's not a functional programming language.
IMHO, a functional programming language requires:
- First-class functions and function literal (lambda) syntax support
- Expression-oriented syntax
- Emphasis on immutable data structures
- Tail call optimization
Other features are 'take-it-or-leave-it'.
- pjmlp 5y agoSo given that ML languages don't require tail call optimizations, and allow for mutable data structures....
- yawaramin 5y agoAFAIK all ML languages support tail call optimization, and put the emphasis on immutable data structures.
- pjmlp 5y agoNope, Scheme is one of the few languages that require tail call optimisation as per language standard. There is no emphasis when mutability is one mut and ref cell away.
- yawaramin 5y agoOCaml doesn't have a language standard afaik, and its implementation(s) support(s) TCO, so imho that's more important. 'Emphasis' just means the 'paved path', i.e. default data structures like records and variants are immutable, default list type is immutable. Of course if you want mutable stuff it's there, but it's not the default.