4 ms·
I don't think it takes any longer to learn Haskell syntax than all of Clojure's reader macros (you will need them and the semantics is not obvious), or Scala's
by platz 13y ago
I don't think it takes any longer to learn Haskell syntax than all of Clojure's reader macros (you will need them and the semantics is not obvious), or Scala's type system which has a lot going on, and I'm not sure about Erlang but I hear grumblings about syntax.
There isn't actually that much in the way of actual syntax in Haskell (LYAH is a great place to start, don't just try to eyeball random code snippets), and it becomes preferable after some familiarity.
What will take time is learning new concepts, programming purely and learning the tools to manage effects.
- im3w1l 13y agoThis is not true at all in my experience. Theano, a machine learning library for the gpu uses pure programming with syntax extremely similar to numpy, took about an hour to understand and "do useful stuff with". I've spent more than 20 hours on Haskell syntax and feel like I am not even halfway there to "doing useful stuff". EDIT: And I think time to be able to do something useful is a very important benchmark because after that point, further learning takes little effort or motivation.
- platz 13y agoWhile I havent used that library, there are plenty of ways to write obfuscated code in Haskell. Some libraries may define their own operators (Scala suffers from this too), which can be impenetrable. Some libraries are better than others. Although, I don't consider defining new operator names part of the syntax of the actual language itself. I guess I'd just hope one doesnt start out jumping in to a complicated library. Its easier to start with more foundational materials.
- platz 13y ago* I can see your point about speed to attain proficiency. I wish I had a good answer for this.
- GregBuchholz 13y agoMaybe it is the pattern matching aspect that is throwing you for a loop? Are you familiar with Prolog, Mathematica, Erlang, or syntax-case macros from Scheme? Or is the the dollar sign ($), or something else that may be bugging you? Maybe post a simple example of one of the worst offenders.
- im3w1l 13y agoIt is not one thing in particular. It is just that there are so many things.
- the_af 13y agoAre you sure it's the syntax? Haskell can be pretty complex to understand due to the abstractions involved, especially if you are less familiar with FP, laziness, etc. When I struggle with Haskell it's more "I don't understand the type of this" than "I don't understand the syntax". Syntax is the easy part!