Re:Rust as a gateway drug to Haskell
by pas on Wednesday June 14, 2017 @07:33AM
(#14551977)
There's nothing wrong with the ability to generalize abstractions, the problem is when all you know are category theory everything looks like a zygohistomorphic prepromorphism.
Case in point, TypeScript and mypy. Both are adding more abstractions, more powerful types, more aspects, because people find/have fitting use cases for those features.
That doesn't mean let blah = document.getElementById("blah") ; blah.innerHTML = "..." or import requests ; requests.post(...) will become deprecated, but it means it'll be easier to express more things (like conditions/assumptions on shape or state of data, control flow, component dependencies) without boilerplate (and copy-paste), and maybe helping other developers make sure they cross all the t-s and dot all the i-s.
Does this have a cognitive cost? Yes, especially in Rust/Haskell.
Are there escape hatches? Yes, of course, like unsafe and whatever Haskell has.
Should a developer who isn't familiar with those assumptions/conditions work on the code base anyway? No, not really.
Case in point, TypeScript and mypy. Both are adding more abstractions, more powerful types, more aspects, because people find/have fitting use cases for those features.
That doesn't mean let blah = document.getElementById("blah") ; blah.innerHTML = "..." or import requests ; requests.post(...) will become deprecated, but it means it'll be easier to express more things (like conditions/assumptions on shape or state of data, control flow, component dependencies) without boilerplate (and copy-paste), and maybe helping other developers make sure they cross all the t-s and dot all the i-s.
Does this have a cognitive cost? Yes, especially in Rust/Haskell.
Are there escape hatches? Yes, of course, like unsafe and whatever Haskell has.
Should a developer who isn't familiar with those assumptions/conditions work on the code base anyway? No, not really.
(Is Haskell ugly? Yes. :( )