17 ms·
I don't disagree in general but is Haskell a big language?
by mac01021 8y ago
I don't disagree in general but is Haskell a big language?
- klodolph 8y agoLarge in the sense that it admits many approaches to solving problems. https://www.willamette.edu/~fruehr/haskell/evolution.html https://www.willamette.edu/~fruehr/haskell/evolution.html
- dwohnitmok 8y agoIt's meant as a joke but as the author of that page points out, I think there's real pedagogical value in understanding all of the examples. You'll learn quite a bit of CS fundamentals independent of Haskell itself. Then please do as the professor does when it comes to production code.
- wtracy 8y agoHaskell has a ridiculous number of obscure operators. Here's a list of "common surprising" operators in Haskell: https://haskell-lang.org/tutorial/operators https://haskell-lang.org/tutorial/operators
- jhayward 8y agoThose are mostly library functions, not part of the language. It doesn't seem any more reasonable to use them to declare Haskell a complex language than it would to have the existence of, say, a linear algebra library providing mathematical operators for Forth mean that Forth is a complex language.
- AnimalMuppet 8y agoDepends on what library they're from. Is the STL part of C++? Sure, it's a library, but it's a standard library - it should be there in every conforming implementation. Personally, I think of that as part of the language. Is some vendor's RS232-port-handling library part of C++? I would say no. In the same way, I think that Java's standard library is part of the language, and is in fact the strongest selling point of Java.
- dwohnitmok 8y agoThose are part of the standard library rather than the language itself though. You can (and a lot of people do) define and use your own standard library instead (hmmm... maybe a rabbit hole of its own? Although it seems companies with legitimate business needs do this as well so who knows).
- dpratt71 8y agoI don't think it makes sense to characterize Haskell as "big" on this basis, because 1) it is trivial to define an operator in Haskell, so there's bound to be a lot of them and 2) even the "standard" operators typically have a simple definition (e.g. https://www.stackage.org/haddock/lts-12.9/base-4.11.1.0/src/GHC-Base.html#%24 https://www.stackage.org/haddock/lts-12.9/base-4.11.1.0/src/...).
- wtracy 8y agoEven if the operators themselves don't count as "part of the language", the complex precedence rules around them certainly should.
- dwohnitmok 8y agoIn what way? Those are defined as part of the operator. I usually parenthesize them anyway just like I would for an equation.
- village-idiot 8y agoOn the whole, I consider user-defined infix operators to be a huge mistake. While the few common ones are great, the ability for every single library creator to add their own infix operator turns into a mess in the long run.
- gowld 8y agoThey fine inside a limited domain-specific scope, just don't go importing operators from many libs willy-nilly.
- village-idiot 8y agoIt’s very hard to convince people to keep them in that limited scope.
- icc97 8y agoI agree that this is one of the things that makes Haskell harder/scarier to learn, but I don't think that it makes it bigger.
- vmchale 8y agoNone of these are remotely obscure unless you don't know functional programming.
- Learn2win 8y agoThere are just functions.
- dwohnitmok 8y agoHaskell 2010 is pretty small. Comparable to say Clojure, but more complex than Scheme. GHC Haskell with the kitchen sink of extensions turned on is big. Very big. Sticking to Haskell 2010 with a few extensions that make known behavior more consistent (GADTs, NoMonomorphismRestriction, and a few others in that vein) is the best bang for buck in my experience.
- hota_mazi 8y agoThe complexity of a language has nothing to do with its size. Brainfuck or Whitespace are two minuscule languages that produce the most impenetrable sources.
- dwohnitmok 8y agoThat's true. I meant size in the hand-wavy sense of "this feels complicated" (although the syntax part is also true in this case). For example there's a GHC extension to overload the meaning of a type declaration (DataKinds). This technically doesn't introduce new syntax but it's definitely a "big" extension in my book.
- Tarean 8y ago> I'm from Microsoft and when you see Microsoft documentation it often says, you know, x y or z is a rich something, right. In this case Haskell - or ghc's version of haskell is a rich language. What does this mean? Sounds good, doesn't it? But it always means this, right. That it's a large, complex, poorly understood, ill documented thing that nobody understands completely. From a great talk by Simon Peyton Jones https://youtu.be/re96UgMk6GQ https://youtu.be/re96UgMk6GQ
- Tarean 8y agoLinked the wrong talk, oups https://www.youtube.com/watch?v=uR_VzYxvbxg https://www.youtube.com/watch?v=uR_VzYxvbxg
- yogthos 8y agoI think the complexity in Haskell largely comes from its advanced type system and laziness. For example, pervasive use of monads in Haskell is a direct result of encoding side effects using the type system. You can't just put a log statement in a function, you have to do a whole design exercise of how to push it to the edge of the application.
- pka 8y agohttp://hackage.haskell.org/package/base-4.11.1.0/docs/Debug-Trace.html#v:trace http://hackage.haskell.org/package/base-4.11.1.0/docs/Debug-... For future reference, this isn’t a good argument for trolling Haskellers.
- fnord123 8y ago>These can be useful for investigating bugs or performance problems. They should not be used in production code.
- pka 8y agoWell yeah, because a logging statement in production can fail (i.e. network connection drops). The type system forces you to deal with that fact instead of letting you write code that e.g. brings down your server unexpectedly because of some random log call. Many would consider that a feature, but if you want to #yolo it anyway, like in most other languages, just use trace in prod and call it a day.
- yogthos 8y agoThe type system forces you to solve this problem in a very specific way by structuring your entire app around pushing IO to the edges. There are plenty of other ways to address the problem that work perfectly fine in practice. For example, you can specify what should happen is IO fails in your logging configuration. This handles the exceptional case consistently and in a single place without forcing you to structure your whole app around it. What's more is that there really isn't a sane way to recover from such a catastrophic failure. If your database goes down, or you lose a disk, the only thing you can do is shut down the app. It's not like it's gonna keep humming along with the logging failing silently. This kind of hyperbole that your either solve all problems via the type system or #yolo is precisely what makes Haskell community so toxic in my opinion.
- rs86 8y agoI don't think it is small or minimal but I believe it to be smaller than Scala
- gizmo686 8y agoHaskell 98 is a simple language. Modern Haskell is not. Or, at least, the superset of modern Haskell that GHC implements is not simple.