3 ms·
> With a better type system, taking ides from Haskell (ADT, generics done well, ... > That being said, it is still a much better choice then a lot of overcompl
by Nitramp 13y ago
> With a better type system, taking ides from Haskell (ADT, generics done well, ...
> That being said, it is still a much better choice then a lot of overcomplicated languages out there.
Devils advocate here, do you see a contradiciton between these two sentences?
- friendly_chap 13y agoNo. Having a nice, feature rich type system doesn't make a language overcomplicated. See Haskell's one. I would argue that having a bad type system definitely can make a language overcomplicated, full of edge cases and dark spots.
- tikhonj 13y agoNo, because Haskell's type system (ignoring certain relatively experimental extensions) is actually quite simple. Many people may find it difficult to learn, but only because it is so different and alien and not because it's some baroque monstrosity. In some ways, Haskell's type system is actually simpler than Go's: there's no sub-typing and hence no real casting. Haskell also tends to eschew special cases in favor of more general solutions; for example, Haskell does not need any magical notion of multiple return values built into the language because this is naturally subsumed by tuples. Similarly, Haskell has generics instead of baking a paltry set of data structures into the language. Also, algebraic data types are actually very natural. Tagged unions (also known as variants or sum types), unlike normal union types, are dual to product types (structs and tuples). This means they are actually just opposite versions of the same underlying structure: very symmetric. And just like in physics, symmetry usually means you're onto something. Haskell has an extremely simple and elegant core; just because it's difficult to learn for some people does not mean it's a particularly complex language. It's certainly simpler than Scala, for example! Certain extensions add quite a bit of complexity, but the most complex ones are not super-widely used so you can reasonably get away without ever dealing with them.
- danieldk 13y agoIndeed, and Haskell itself is translated into the (very simple) Core language: http://stackoverflow.com/questions/6121146/reading-ghc-core/6121495#6121495 http://stackoverflow.com/questions/6121146/reading-ghc-core/...