
Four months with Haskell - rwosync
https://lexi-lambda.github.io/blog/2016/06/12/four-months-with-haskell/
======
slezakattack
I programmed Haskell professionally for about a year and a half. My last
company has been trying to hire Haskell engineers for over 2 years and we've
only managed to hire at least 2. "Hiring Haskell developers is not hard", is
extremely subjective and naive to say the least. Obviously, YMMV, but the
front-end devs that the last company was hiring was running laps around the
Haskell team. Honestly, finding a Haskell engineer is not always a winner
either. I've found that the ones we hired are very smart but not very decent
engineers (i.e. defining requirements, shipping a product on time, understand
tradeoffs, etc.).

There were quite a few things about Haskell that I truly love and miss, such
as the type system, but the tradeoffs just weren't worth it to me and I
honestly don't think it's mature enough to be considered "enterprise ready".
Aside from the learning curve, there were several bugs in one of the Haskell
libraries that caused frequent outages (until we were able to pinpoint what
was wrong), lazy evaluation caused excessive memory bloat when used
incorrectly, and my all-time favorite: needing to switch on profiling in order
to get stack traces (this is suppose to change in future GHC versions) which
defeated the whole purpose of "haskell is fast". I don't know, perhaps we were
using Haskell wrong. From a business perspective, it just wasn't making that
much sense given how difficult it was to hire, getting engineers excited to
learn it, and having the features needed to monitor a production system.

~~~
codygman
> Aside from the learning curve, there were several bugs in one of the Haskell
> libraries that caused frequent outages (until we were able to pinpoint what
> was wrong),

What was the bug and what was the library?

~~~
slezakattack
This was a couple years ago when I was starting off with Haskell and was not
intimately involved with what was happening. IIRC it was something to do with
opening too many file descriptors on /dev/urandom. I think it was linked with
one of the random libs. That's all I can remember.

~~~
implicit
I remember that. One of the crypto libraries was implemented by using
unsafePerformIO to access a global handle to /dev/urandom rather than
accepting another parameter.

For what it's worth, this bug was an outlier. The pitfalls of unsafePerformIO
are relatively well-known.

For contrast, there a bug in PHP's opcode cache that causes memory corruption
in our setup. The best we've managed to do to deal with that by patching PHP
to bump the refcount of some object to a billion. The failure condition is
sufficiently obscure that it took us multiple man-months to figure that much
out.

------
p4wnc6
I fall in a weird bucket: very advanced understanding of some other languages
and good work experience, education, etc., but even though I love Haskell and
practice it all the time, I think I am just somewhere on the boundary between
beginner and intermediate, and even with focused daily effort I would remain
on that boundary for a long time before there is a phase transition to solid
intermediate.

Because of this, the only kinds of FP shops that would hire me want to hire me
at a junior or low-paying level, but my market value in lots of other skill
areas (machine learning, Python, database stuff, etc.) is much higher, so I'm
not willing to take a salary anywhere close to what they think fits the
position.

As a result, even though I would love to get industry experience with
functional programming, there is a market wage energy barrier preventing me
from considering it. I was burned once early in my career with malarkey about
how you should accept a lower salary for some alleged other benefit (like cool
functional programming, or working with a team of awesome people, or getting
in on the ground floor on something, etc.) -- I won't make that mistake again.

So I basically had to learn to divorce myself from real world Haskell
practically just as soon as I learned how much I really love it.

Plus, and this should not be discounted, the professional tooling with Haskell
is still extremely immature with lots of esoteric corners duct taped together
in unsatisfying ways. It's getting better, but if you work with Haskell for
real there are likely to be as many, if not many more, extremely frustrating
painpoints of the language tooling as with any other language, enough to
amortize away all the warm fuzzy happiness you'd get from the status effects
of being able to say you do pure functional programming for a job.

~~~
SatvikBeri
I was in a similar boat. I found that it's relatively easy to get machine
learning jobs at market pay in Scala, due to Spark etc. taking off, and
functional Scala is about 80% as good as Haskell (whereas e.g. Python is about
20%). For example, the company I'm working at, Euclid Analytics, uses Scala as
our primary language.

~~~
p4wnc6
My experience has been two-pronged with Scala.

About half of companies using Scala are only doing so because it is a trendy
way to trick people into continuing to maintain god-awful legacy Java
(basically same for Clojure too) -- and in these places they code Scala like
it is Java, e.g. use mutability everywhere, poor code style, no emphasis on
functional patterns.

The other half seem like legit and interesting jobs, but they tend not to
believe that self-taught Haskell experience, or on-the-job machine learning
experience with say Python (even with pyspark) is translatable to Scala, and
they heavily emphasize seeking people who are specifically experienced in
exactly their tech stack already and immersed in the culture of it.

Either way it creates barriers that make it seem like my quality of life
wouldn't be very good switching to Scala. But if I found a company that valued
what I already can do with Python and my statistics experience, and was happy
partially training me / helping me while I teach myself idiomatic Scala, that
would be great. It just seems impossible to find that, even though some
companies pay lip service to that idea.

~~~
SatvikBeri
If you're in/willing to relocate to San Francisco, feel free to message me–I
definitely can relate to your experience about dramatically different Scala
cultures, and could recommend some companies that will likely value your
experience while being willing to train you in Functional Scala (including my
current employer, where I lead a Scala study group.)

~~~
p4wnc6
I appreciate that -- unfortunately I am focusing mostly on the Eastern US for
family reasons and I doubt SF would work out for me. Glad to hear there are
some good Scala companies out there though.

------
sdx23
Nice article. Although at some points I disagree with the author.

The part on errors is mostly "some guys use error but don't mention it".
Partial functions are not nice, that's true. In some cases tools like hlint
may help. Actually I'm wondering there's no tool / hackage functionality
around, that flags modules / (pure) functions that are partial.

For documentation: Starting with Haskell I felt the same, some more examples
and more documentation would be nice. But in the meantime I've come to like
the concise documentation most often used. When searching for a certain
function I don't want to read screenpages of text, but find that function
fast. If, however, I need more detail or want to be really sure what the
function does I need to read the source anyway.

However, true is that some libraries lack _any_ documentation and it seems you
should be grateful to have the typesignatures.

Also, I think more libraries should have examples/ directories so one can get
at quick glance how the library is designed to be used. Perhaps even have
hackage emphasize the existence of these examples more.

------
Thaxll
"Hiring Haskell developers is not hard", it's already hard to get good Java
developer can't imagine for Haskell...

~~~
boothead
This is actually the other way round. Given:

1\. People who learn Haskell put in a lot of effort for their own learning
benefit - they're not usually learning Haskell to get a job.

2\. Once you learn Haskell you really kind of want a Haskell job to put all
this nice stuff into practice.

3\. There aren't many Haskell jobs about (in part due to a perception that
it's hard to hire Haskell developers).

As a company in the lucky position of hiring for a Haskell role you have a
pool of people who have self selected to be above average in determination and
smarts, but limited options in employment in their new tech of choice.

 _source_ Built a Haskell team at a startup, now work on a Haskell team in
finance. Hiring has NEVER been a problem.

~~~
jlarocco
> As a company in the lucky position of hiring for a Haskell role you have a
> pool of people who have self selected to be above average in determination
> and smarts

[citation needed]

There's really no evidence that people choosing Haskell are any smarter or
more determined than anybody else.

I'm mainly pointing this out because the Haskell community's "We're smarter
than everybody" attitude is a big pet peeve of mine.

~~~
dasil003
I understand your pet peeve, really I do, but if you look at the
contrapositive statement I think you will find it hard to argue:

People who are just looking to get into software engineering for the money are
unlikely to learn Haskell.

They will almost certainly learn Java, PHP, Ruby, Node or maybe even Go, but
not Haskell. And looking around SV these days, there is a huge number of
people around that are only in it for the money.

Not that that is a panacea... my instinct is you might end up with a very
strong technical team, but one that might be more likely to miss the forest
for the trees when it comes to building a successful business.

~~~
jlarocco
> They will almost certainly learn Java, PHP, Ruby, Node or maybe even Go, but
> not Haskell. And looking around SV these days, there is a huge number of
> people around that are only in it for the money.

I think you're confusing orthogonal issues. Only writing code because it pays
the bills really says nothing about how smart or motivated a person is. Is
there a rule somewhere that dumb people can't enjoy programming and learn
Haskell? On the other hand I know a few very smart people who only write code
because it pays their bills.

~~~
dasil003
I'm not confusing anything, I just disagree with you.

It's not about smart vs dumb, it's about intrinsic versus extrinsic
motivation. Being smart is an advantage, but it is meaningless without a
massive amount of practice. There's nothing about programming that a 100 IQ
person can't become competent at it.

Programming is first and foremost, an exercise in frustration. It is exacting
and unforgiving in a way that few human activities are. It's somewhat
unnatural. In order to excel at it I believe you need to feel an intrinsic
thrill when solving a problem that surpasses all the frustration leading up
that point, and you need to seek this out over and over and over.

Note that this says nothing about whether you only work for money, or even
what brought you to the field. However, if you do not feel this thrill, then
you will naturally gravitate towards a job where you can execute rote
incantations again and again without having to face new problems. I'm sure
there are people who love programming and persist in it despite being terrible
at it, but I guarantee you they are far outnumbered by the hordes of wannabe
tech millionaires flooding into the Bay Area as we speak, completely oblivious
to how much they will actually hate and subsequently suck at programming—and
those people ain't learning Haskell.

~~~
tejon
> Programming is first and foremost, an exercise in frustration. It is
> exacting and unforgiving in a way that few human activities are. It's
> somewhat unnatural. In order to excel at it I believe you need to feel an
> intrinsic thrill when solving a problem that surpasses all the frustration
> leading up that point, and you need to seek this out over and over and over.

This is more than two tweets long. How is it supposed to become the viral
quote it deserves to be?

------
harry8
Here is the part where I want to update my data point about how many
applications I can run for doing something other than writing code where the
program was written in Haskell. This data point is useful because hackers
gotta hack. If there's still not much here then I'm forced to assume that
haskell still has problems that aren't being talked about.

Off the top of my head I've got:

pandoc - translates from one document format to another

ion - a window manager

git-annex - store stuff in git without it being in git.

If we can get to 50 useful "apt-get install"-able programs Haskell will be
worth looking closely at again.

This is not trolling, this is useful data. We know FP is fun, cool, funky and
all that. It's a different discussion as to what problems remain (if any) and
how to solve them (if needed). I just want to see where we're up to in mid
2016.

~~~
hudon
darcs and xmonad come to mind

------
Ericson2314
I totally agree with the downsides. Ban synchronous exceptions now!

Thank goodness everything else is library/ecosystem, rather than language,
problems. I think those are easier to fix :).

------
mikerichards
I'm not a Haskell programmer, but I wish more languages had Newtypes.

Most of the time I'm too lazy (or consider it too much boilerplate) to wrap
strings in classes. But on more than one occasion I've spent too much time
tracking down a bug because I passed the wrong string to the wrong argument in
a method.

~~~
louthy
I implemented a newtype [1] system in C#. It's (obviously) not as robust as
Haskell (relies on some runtime checks), and isn't as efficient (reflection
and boxing for value types). But if type-safety is what you want, it's
definitely an improvement over passing integers, strings, or other basic types
around.

[1] Implementation - [https://github.com/louthy/language-
ext/blob/master/LanguageE...](https://github.com/louthy/language-
ext/blob/master/LanguageExt.Core/NewType.cs)

[2] Unit tests / examples - [https://github.com/louthy/language-
ext/blob/master/LanguageE...](https://github.com/louthy/language-
ext/blob/master/LanguageExt.Tests/NewTypeTests.cs)

[3] The request that led to the feature - [https://github.com/louthy/language-
ext/issues/95](https://github.com/louthy/language-ext/issues/95)

------
AnTaoiseach
This makes no sense whatsoever. Purely subjective speculation at best.

~~~
tome
Did you also say that about PG's article 12 years ago?
[http://paulgraham.com/pypar.html](http://paulgraham.com/pypar.html)

~~~
AnTaoiseach
Paul Graham is overrated. I believe almost every developer goes through a
phase where they are enamoured by his writings, and thanfully, they grow
through them when they get into the real world. Perhaps your time will come
soon too.

~~~
tome
That seems unnecessarily personal.

I am honestly curious whether you think PG's opinions on Python 12 years ago
also "make no sense whatsoever" and are "Purely subjective speculation at
best". Speculation about my professional growth is irrelevant.

~~~
CyberDildonics
> Did you say the same thing about Paul Graham's writings? > That seem
> unnecessarily personal

~~~
tome
Sorry, what do you mean?

~~~
CyberDildonics
I'm saying don't play both sides of the coin, an ad hominem attack and then
acting like someone else is a bully.

~~~
tome
Which ad hominem attack?

