3 ms·
What I'm realizing in trying to develop my own (admittedly limited in scope) functional language is that "fancy type systems", or at least "fancy some-kind-of-s
by jarcane 12y ago
What I'm realizing in trying to develop my own (admittedly limited in scope) functional language is that "fancy type systems", or at least "fancy some-kind-of-structured-value-thing" systems go a hell of a long way to making it not an interminable pain in the ass.
The hardest thing for me to "get" about FP is that some problems really do require an awful lot of persistent data to be easily converted to values to be passed back and forth instead. Something like, say, a VM, that's a piece of piss to code in a language that allows mutable state can become an interminable mess of gobbledygook or just a huge pain in the ass in a lanugage where the means for passing data structures is too verbose or complicated (like say, Scheme/Racket structs).
This is why the 'fancy types' in Haskell, I realized, and the robust syntax for dealing with them. Because they become the main medium for communication within your program in anything non-trivial, and you need that process to be as frictionless as possible for the FP approach to not fall apart completely into a very tedious sort of chaos.
- tel 12y agoThe other way to look at it is that Haskell allows all of this information which would be otherwise implicitly embedded in the abstractions, style, and conventions of a language to float to the top to a formal, verified type language. So you can see them as a primary tool to handle the complexity or the driving force for exposing all the complexity in the first place!