8 months of OCaml after 8 years of Haskell in production

Idk, honestly I don’t think even ocaml could stand for long-term, while it is going great atm. At this point, it seems more likely that python or similar languages would dominate entirety of programming as a universal language, while some C-like language supporting from below. Nothing else can persist for long.
Or, you know, AI might make the concept of programming languages obsolete; the practice of programming would still be alive, but that does not mean languages shall as well.

I don’t think you have to be so clinical about it.

The most important part of a startup (or any project) is actually writing the code. If I were to found a startup again, I’d probably go with Haskell. Because if I didn’t, I probably wouldn’t have as much fun coding. So I’ll build more faster and better writing Haskell than if I pick something like Rust or Go or Java or whatever.

Professional consumer software development has a lot of inherent grotesqueness. Haskell is a nice counterweight to the industry due to its design, culture, and values thankfully going against the grain. Especially if you lean into it and don’t end up with “mainstream software org chart that happens to write Haskell.”

Having fun is the real secret sauce to success imo. Or at least, that’s what I’ve been learning in my career so far.

6 Likes

Even if you didn’t write any code and would just do the hiring?

1 Like

If I were to found a startup again, I don’t see how I wouldn’t be doing actual engineering. Since it’s my core competency. Like, any startup I’d found would either be predicated on technical ideas I have and want to execute, and I’d be cofounding with someone more business-focused if necessary to round out the founding skillset.

The point being, there are definitely sorts of people who would found companies in Haskell. Not just because it’s an obviously efficient business decision.

2 Likes

I can rephrase the question.

A friend of yours is starting a company and wants your advice on what technology to pick (let’s say something generic like an online shop). You don’t have interest or capacity to co-found or get involved other than doing some hiring for them. Would you make them pick Haskell?

1 Like

I mean of course not. I’d tell them to pick whatever the technical founder(s) feel most effective with and whatever vibes with the engineering culture they want.

1 Like

There is no technical founder. They have a product owner and want to hire a lead developer to carry out the tasks.

1 Like

I’d first tell them to get a technical cofounder if their company is a software company with technical problems to solve on its path to success :slight_smile:

3 Likes

Well, you’ve avoided the answer successfully, which to me means you’re not thinking of Haskell as a business solution, but as your personal preference to have fun in programming. Is that accurate?

1 Like

I didn’t avoid the question, I answered it.

You are either misunderstanding or trivializing the value of Fun in professional software development and startup success. I wasn’t being trite and telling people to mess around. I was giving insight into what I think results in successful, sustainable, long-lived software projects and companies that I’d want to spend my limited time contributing to.

All of my advice is business advice and comes from my own professional experience! Both a decade doing pure FP in production and a stint cofounding a startup for 3 years (with key parts of its stack built with Haskell and Elm). I am not being unserious in any way.

7 Likes

I want Haskell to be an inspiring language that embodies a vision, by taking a small number of unifying ideas, and see where they lead. Specifically:

  • Purely functional programming.
  • High-end static type systems

Now, that may not be everybody’s vision. Maybe the vision will die; maybe no one will use Haskell or OCaml, and maybe no one will care about functional programming. But I am much more optimistic than that. I think that purely-functional, statically-typed programming is just a better way to write programs, and
that has steadily become more and more apparent over the last four decades.

It is certainly possible that, rather than adopting Haskell or OCaml as-is, the mainstream world will simply absorb the ideas that they embody. Indeed, you can see Lisp/ML/Haskell/Ocaml fingerprints all over mainstream languages: garbage collection, lambdas, type classes, monads, generics, comprehensions, and so on. The ideas may not be as elegantly expressed, and in some cases may not even be feasible in practice (e.g. STM flourishes in Haskell but has been mostly abandoned by the mainstream); but they can still be extremely influential.

So what is the role of the Haskell community? I suggest

  • Stay true to the vision. Make Haskell elegant, expressive, and crucially (as others have said) fun.
  • Work hard to knock down obstacles to using Haskell in mission-critical applications.
  • Do all this in a collegial, diverse, open-source community, in which people trust each other.

See the Haskell Foundation vision.

These goals are enough for me personally. Maybe it will result in Haskell being more widely adopted; maybe not. But meanwhile it is a rich, rewarding, and intellectually challenging endeavour.

51 Likes

Exactly. My answer to the question “should I use Haskell” is basically “if you hire me”.

  • hiring is hard
  • senior Haskellers are expensive
  • talented Haskell juniors will stay 1-2 years max in your company, before they transition to an employer you can’t compete with
  • many programming domains are underpresented in Haskell apart from generic backends, which means you might end up doing very heavy lifting of being a pioneer (this comes from painful experience of dealing with a custom event sourced Haskell backend)
  • many of the libraries you use will be abandoned half way into your project
  • onboarding new Haskellers is always challenging: people are into different corners of the language and what seems like an easy to understand codebase for some, is a nightmare for others
  • a Haskell codebase that has survived a couple of generations of different Haskellers can look like an odd giant… because there are so many ways to do the same thing
  • the tooling can easily become a bottleneck… compile times, HLS crashing, expensive GHC upgrades, …

And yet… it’s fun, at times.

So… “should I use Haskell?”. Well, “no”, unless you know what you’re getting into or you’re an invested enthusiasts.

But… I think that perception should change too. I’d like to recommend Haskell even to people who are not FP enthusiasts and say: “Yes, use Haskell, because the libraries are excellent, the tooling is smooth, the compiler is reliable and fast, hiring is easy and there’s lots of great documentation and advanced guides on how to evolve and structure your projects”.

That is a different kind of fun… it’s the fun that comes with smooth, pleasant user-experience and less with an expressive, elegant language.

We’ve managed the latter through those excellent researches like @simonpj, pioneering language research. But I think there’s a long way to go to make Haskell fun in those more boring ways.

So no, I don’t think I’m trivializing fun in software development.

12 Likes

A counterpoint:

Hiring people who wanted to work with Haskell was very easy for us. We are the only Haskell team currently, so there was a lot os skepticism at the outset. We managed to hire the full team in record time, to the point that other managers asked me what my secret was.

17 Likes

A breakthrough might happen (and I think it’ll come from cutting-edge features, not stability). Things like lens, servant or parallel computing are things were Haskell shines (obviously not enough).

That’s a very good idea. Making Haskell even more practical is probably not the best way to increase its user base. Making it more fun, creating absolutely new things no other language has (or even can have) — that’s the way to go.

Doing things in a fear of the language not being used otherwise could be a self-fulfilling prophesy. Haskell could become so stable and filled with backward compatibility that there will be no fun in using it.

Obvious obstacles should be fixed indeed, even more so if in a backwards compatible way. But it shouldn’t be the main focus.

5 Likes

As for any other innovation:

But wouldn’t a successor to (Glasgow) Haskell be the ultimate innovation? If not, another option is a new Haskell compiler…

I think the friction is more philosophical than technical tbh. Better tools won’t resolve that.

But we don’t need anyone and everyone to adopt Haskell! There’s a saying: “Marketing is deciding who not to sell to” :grin:

1 Like
  • hiring is hard
  • talented Haskell juniors will stay 1-2 years max in your company, before they transition to an employer you can’t compete with

So it’s both not hard for someone to hire and not that hard to find a job (which seems many people have an issue with)?

Excellent points about other aspects. For me, the main fun of the Haskell is how elegantly one can solve problems in it. Basically, how amazingly good a good software design looks in Haskell.

Unfortunately, people rarely write about simple Haskell that does the work well as it’s not that interesting. But people love to write about crazy experiments. Which is great and pushes progress forward, but it leads others to think that this is Haskell. Then people start using experimental effect systems or lenses everywhere, and we get:

  • onboarding new Haskellers is always challenging: people are into different corners of the language and what seems like an easy to understand codebase for some, is a nightmare for others

I think Haskell lacks a body of industrial usage wisdom. Everyone knows that C++ template metaprogramming leads to overcomplication, but not everyone knows which Haskell features/approaches should or should not be used in production systems.

Haskell’s expressiveness is a double-edged sword: one can both implement an amazingly simple and an amazingly complicated solution. And this is something that should be covered more in a Haskell world (“software engineering fun”?).

One can jump to OCaml in search of simplicity, but that’s like throwing the baby out with the bathwater.

8 Likes

Heh I wrote a little (over-simplified) gist about the tension that arises from this in general (not just juniors) years ago PLs-misaligned-incentives.md · GitHub

1 Like

That friction will diminishes overnight if one of the big company decided to use Haskell

IIUC, the current OCaml splash is mostly thanks to Jane Street backing a lot of new features.

It’s quite fun that about 15 years ago OCaml was basically a dead language. I could write a similar “4 months of Haskell after 4 years of OCaml” when I made an opposite switch back then:

  • Haskell has a parallel runtime,
  • more features,
  • more libraries,
  • more tools,
  • bigger and more active community,
  • nicer syntax,
  • type classes, lazy evaluation, …
  • slightly slower in some sequential programs, but we could fix it with parallelism

Only parallelism aspect has changed recently.

What’s interesting is that more features lead to unnecessary over-complication and that’s the point I’m completely agree with @ChShersh. I’m not yet sure what to do with this.

7 Likes