5 ms·
IMHO Haskell is missing three features that would really improve programming in the large: 1) better structural types. For example, polymorphic extensible reco
by willtim 6y ago
IMHO Haskell is missing three features that would really improve programming in the large:
1) better structural types. For example, polymorphic extensible records and variants. These could even be the basis for all algebraic data types. Current encodings have poor syntax and poor type inference (due to non-injective type families). The need to make all records nominal types really gets in the way when dealing with structured data. Python is the main competitor here; and so we could also just use strings and maps, but we can do better.
2) a better module system. Even Miranda had a better module system than Haskell. OOP has first-class modules.
3) a better commitment to backwards compatibility. There have been controversial and breaking changes to Haskell's standard libraries that have done more harm than good. This has likely damaged industrial adoption of Haskell. For example, my employer, a prominent Haskell sponsor, is stuck on a 7-year old version.
Unfortunately the above problems are difficult to retrofit for and so I think a new language may ultimately be needed.
- Ericson2314 6y agoYou realize 3 would make 1 and 2 harder or less valuable? And 3 would have also prevented a gazillion 1s and 2s from being still with us? I think breaking changes are highly underratted and people only shy away from them because the tooling expectations in all languages are so rock bottom.
- willtim 6y ago> You realize 3 would make 1 and 2 harder or less valuable? Yes that is why I think (1) and (2) need a new language. > And 3 would have also prevented a gazillion 1s and 2s from being still with us? I disagree. Most new features have been implemented as extensions that must be enabled with language pragmas. This is not the same thing as large breaking changes in the standard libraries.
- IngoBlechschmid 6y agoIsn't constructing a new language the ultimate breaking change :-)
- Ericson2314 6y agoI wish more people would realize this!
- eyelidlessness 6y agoI don’t have a dog in this fight other than interest in ML-family langs generally and Haskell as a pervasive interest everywhere I go outside of Haskell. But... No not really, if your language is intentionally designed to be a foundation for other languages. So many lisps are trivially host languages for other languages at their core. Even JS is at this point, with the widespread use of Babel and various bundlers. Those languages themselves are seldom very different underneath that.
- Ericson2314 6y agoMaking a "language laboratory" for typed languages, (as opposed FFI with lowest common denominators like C or so-and-so untyped, garbage-collected language) is an open problem. I think it can be solved, but until it is, it's wishful thinking to pretend a multitude of similar languages doesn't result in tragic fragmentation of a small community.
- eyelidlessness 6y agoTypeScript seems to be doing alright? Maybe there’s something I’m missing but TS is basically a type checker on top of everything JS compiles to, including the whole Babel universe and compiler transforms that support macros and arbitrary AST manipulation. Even its standard config offers a multitude of similar languages.
- Ericson2314 6y agoHaving a type language on top of an untyped one is fine (except for perf). It's having multiple typed ones that compose well and aren't just reskins of the same basic type theory that's the harder part.
- willtim 6y ago
- kthielen 6y agoPeople have made languages to address these issues (including me), and even put them in critical systems, but it is very difficult to get people to sign on to a new language.
- tikhonj 6y agoThe practical problem is that backwards compatibility and making real improvements to the language are fundamentally at odds. There's just no way around it. If you can't break compatibility, you can't make meaningful improvements except for adding features and capabilities—and most of the problems in this article are about things that need to be taken away, not things that need to be added!
- willtim 6y agoI was responding to "Can Haskell evolve?", I was trying to say "I think it can, but I would prefer it to evolve in a new language". The standard library is riddled with partial functions, like head and tail. We should not take them away and break thousands of projects, research papers, books and blog articles.
- tome 6y ago> We should not take them away and break thousands of projects How about the middle ground of marking them as deprecated and not to be used in new code?