12 ms·
I like haskell. It reads like a math proof more than a cooking recipe. very elegant. I'm a math guy and i'd love to get back to it in my free time. But i don't
by timwaagh 8y ago
I like haskell. It reads like a math proof more than a cooking recipe. very elegant. I'm a math guy and i'd love to get back to it in my free time.
But i don't think i could recommend it for the enterprise. not honestly. I tried to do a professional project in Haskell once. it was a good fit, since it was about parsing and generating configuration. However I was still new to it. the bottom line: it's just not that great for newbies. since most people are going to be newbies at it, i could not recommend it at all. sometimes i think the language even goes over my head, and I'm supposed to be a pretty smart cookie.
OP makes 'they are not going to be productive for months' sound like an obstacle to overcome. But if I tell management the honest story in advance and they will obviously not give me the greenlight.
But i suppose it is a language that's a reasonably easy sell to management if you hype up the reliability stemming from the type system and skip over the downsides. managers dont know much about programming, but they hate incidents even more than developers. if you are honest, you have to tell them that in practise operational problems become more likely. I mean: ever tried to install ghc on a centos server behind a firewall?
If i have to recommend something now it would be python. because it's easy and because i started using it for my personal stuff. i know lots of languages and that's what i end up coming back to if i need to do stuff quickly.
OP doesn't even mention the real advantage to introducing Haskell. Few colleagues will end up being good at this, so if a piece of critical software is written in Haskell and you are the only one who is a great Haskell engineer, it increases your negotiating power in the company. people won't be able to get around you and it will be hard to deny a request for increased compensation.
- platz 8y ago> OP doesn't even mention the real advantage to introducing Haskell. Yes, he does - contrary to the non-technical political motives you outlined - he outlines the importance of a strong type system for maintenance and refactoring—A property much harder to achieve in something like python. I think your own experience of having some difficulty bringing your previous skills to bear on the language is not so uncommon—This is why mentors are so important.
- sdinsn 8y ago> he outlines the importance of a strong type system for maintenance and refactoring—A property much harder to achieve in something like python. Of course a typed language is going to have a better type system than an untyped language... When you compare to a language like Java, your argument doesn't shine.
- thedataangel 8y agoHaskell's type system is _worlds_ better than Java's, and it's absolutely essential to the maintenance benefits that Haskell gives you over other languages.
- crehn 8y agoJust curious, but care to give a practical example of how it's worlds better?
- thesz 8y agoType system can prevent classes of mistakes. One such example in my experience is modeling (and designing) hardware. Strict checking of lengths of bit vectors (just bit vectors!) will make mistakes like "incorrect interpretation of memory address" much harder to be made. Add another one: the "ready" bit for some bus values can be described as Maybe type. Pattern matching on value of Maybe type makes impossible to access bus values when "ready" bit is down (Nothing case). You get rid of another class of mistakes. For this to work in more or less usable way, you have to be able to specify in type level equalities like "concatBitVectors :: (rlen ~ Add alen blen) => BitVector alen -> BitVector blen -> BitVector rlen". This is just not possible in Java. It is possible in C++, but C++ lacks algebraic types like Maybe and more. It is possible in Scala, but Scala has its own pecularities (modifiable variables are absent in hardware).
- thedataangel 8y agoPractically speaking, Haskell's type system gives you a lot of code for free. Stuff like "toString", "equals" and inequalities that you'd usually implement manually in something like Java are done for you automatically by the compiler, with a one-line directive. That system is extensible as well, so for example you can automatically get Serde code for stuff like JSON, Avro, Protobuf etc with a one-liner. On a more abstract level, there's a lot of stuff you can express in Haskell that's difficult or impossible on a technical level in Java. For example: - Functions which are polymorphic in their return type, so that what they do is determined by what type the caller wants them to return. - Function constraints - for example try to express "A function which takes two polymorphic arguments, which must both be of the same type, and which must be orderable (i.e have <, ==, >, etc defined for them), and returns the same type" in Java. In Haskell, that's just "f :: Ord a => a -> a -> a". - Higher kinded types. These let you have (loosely speaking) polymorphic containers. For example, instead of List<A> and Set<A>, in Haskell you'd have something like Traversable t => t a, where Traversable is a particular interface you want your "container" to implement.
- vmchale 8y ago> the bottom line: it's just not that great for newbies. since most people are going to be newbies at it, i could not recommend it at all. sometimes i think the language even goes over my head, and I'm supposed to be a pretty smart cookie. mmm. > If i have to recommend something now it would be python. because it's easy and because i started using it for my personal stuff. i know lots of languages and that's what i end up coming back to if i need to do stuff quickly. Python and Haskell are useful in completely different domains.
- timwaagh 8y agoat the train station we have some Haskell application which does one thing: it does accounting of the number of free and parked bicycles in each rack. in this case a comparison with another programming language is useful. my comment is necessarily about applications where a comparison is useful, not those specialized financial applications at investment banks where Haskell is popular for undoubtedly good reasons i have absolutely no clue about.
- platz 8y agoBy 'different domains', I don't think he was implying specialized financial applications as the only good domain for Haskell. Haskell is a very good general purpose programming language for the reasons the commenterd gave in the thread. It is great for all kinds of general backend tasks. The kind of tasks one would associate with Java would also be a great for for Haskell. Python is also general purpose. It's dynamic typing is especially good in specialized domains of rapid prototyping and exploratory data analysis (perhaps useful at investment banks too).
- erik_seaberg 8y ago> most people are going to be newbies Only briefly; I expect to be proficient with a tool for most of my time with it. If I constantly find myself near the bottom of the learning curve, that means I'm impulsively choosing and abandoning tools way too quickly for the payoff.
- marcosdumay 8y ago> it's just not that great for newbies At the other hand, if you filter your hires by people that know it, you are assuring you won't get a newby.
- throwaway9d0291 8y ago> the bottom line: it's just not that great for newbies. since most people are going to be newbies at it, i could not recommend it at all. I don't think that disqualifies it for enterprise. People will start as newbies and they'll have a very difficult initial hump to get over but once they've been using it for a few months they'll be productive and after a few years they'll be very productive. Unless turnover is so bad that a substantial portion of your workforce is always "new", use of Haskell should be a net positive for a company. There was a study a while ago (http://www.cs.yale.edu/publications/techreports/tr1049.pdf http://www.cs.yale.edu/publications/techreports/tr1049.pdf) that had programmers experienced in each language solve a simplified but non-trivial problem for the US Navy in their given language. Haskell was rated quite highly. There was even a case where a newly-hired college graduate was given 8 days to learn Haskell, with assistance from an experienced Haskell programmer. The college graduate was then asked to solve the problem using Haskell and still performed very well. So I don't think it's impossible to learn Haskell quickly either, it just requires access to an experienced mentor, something an enterprise could provide.
- pdpi 8y agoI vaguely recall reading a story about this report — the Haskell solution was considered quite elegant, but some people felt that it was somehow "cheating" and not a real, fully-baked, solution because of the way it used functions to encode regions.
- platz 8y agoI also think we should stop linking the Navy study