3 ms·
Looking at Rust, Swift, Scala, even JavaScript ES6, I think that Imperative and Functional styles are doing pretty well together.
by eranation 11y ago
Looking at Rust, Swift, Scala, even JavaScript ES6, I think that Imperative and Functional styles are doing pretty well together.
- hoopd 11y agoThe Lisp languages usually do Imperative right out of the box, at least going back to the 70's with Scheme. Python has multiple paradigms...it seems more common for languages to handle both Functional and Imperative than to just choose one.
- the_af 11y agoI can only speak for Scala: it's doing "pretty well", but in some aspects it's not doing as well as it could, were it a purely functional language. Scala has a lot going for it, not the least its interoperability with Java. But being a hybrid language is not zero-cost: its type inference for example is less powerful than Haskell's (it can infer fewer things; I've read this is because inheritance complicates things), and to me its type signatures are harder to read. Also, because pretty much every Scala function has "purity escape hatches" built-in, you can never be sure what does or doesn't have side-effects. And this is unrelated to purity, but Scala's null makes me sad.
- tel 11y agoThe weakness of type inference arises, as you note, due to subtype polymorphism. You can't escape from this when you've got class-based OO, it seems.