How to grow the (commercial) Haskell user base?

I have wondered whether in the medium term, a good way to go would be to improve the interoperability and compatibility with Rust.

There’s not a great deal of formal synergy between the two languages, but I think that there is some social synergy: the Rustiest of systems programmers might be drawn to Haskell if they wished to dip into very high-level programming, and, conversely, the functional programmers who use Haskell are likely to want to use Rust if they need to dip into systems programming.

3 Likes

Some initial thoughts on what I think would be good to see when visiting haskell.org, starting with the home page. I appreciate that some of these things require significant effort, but not all:

Benefits advocated over features. I don’t think we should assume visitors know the benefits of, for example, the Statically Typed feature. What if they are a business decision maker, or newer to development? Start with a benefit, reveal how Haskell delivers it, and expand on click to feed those hungry for details.

Videos curated for adoption purposes. The videos are great, but are they increasing adoption? The list feels quite static, but when it changes, I think some motivational/on-ramp content would be good (along with knowing at a glance which they are).

In general, the homepage should appear updated recently, even if it’s just version updates. And a first eyeful has those videos, but if they aren’t driving adoption, it might be better to move benefits up there. Answer “Why Haskell?” at first glance. I think the homepage should be an all-out adoption funnel for newcomers, dev and biz alike.

For the Get started page:

Really like the introductory tour idea of @jazzlobster.

Still would like an equivalent of the Rust Book. It isn’t perfect, and does too much sometimes, but it’s free online and a more accessible read than many Rust books out there. I think Haskell could go far with less, paying attention to pacing, showing how to achieve practical wins, and correcting errata.

Haskell by Example. I think getting straight to examples without installation is great when people want more of a taster before installing locally, and do like “Try it!” on the home page.

There’s too much text in my opinion, and I’d like to see jumping off points generally, unless “first steps” can be brought concisely inline.

I’d like to mention the learning path overall:

A problem affecting many interesting subjects is the “curse of knowledge”. Smart generous people wish to pass on their knowledge, but it isn’t always at a pace that others can consume. I think there is a place for Haskell.org to help smooth out and direct the learning path, with early educational assets the community has involvement in, and advice about how to progress through to jobbing intermediate level.

8 Likes

OK: I lied. One more problem -

Haskell forums are famous for " I’m completely with you. I have the same experience with the Haskell subreddit, r/haskell . I can’t understand most posts - they’re meaningless to me. Yet I’ve been writing apps with Haskell for years."

No, you shouldn’t stop making posts like that - but you should keep them in their own threads and try to promote discussions about eg useful libraries too. Letting them leak into a thread like this - no! Keep them away from threads for newbies too. Try to look like Haskell is an accessible language with an accessible community.

This is how I would suggest selling Haskell - it would be page one of a Haskell By Example:

Haskell is a strange, strange language. Just not quite in the way the memes say - it’s not as hard to learn as the memes make out (although it is a language that best suits dedicated programmers) and IO is actually easy. It’s strange because it maxes out expressivity - the stuff that programmers love - and safety at the same time. If it was a food then it would be a bacon covered cheeseburger or chocolate sundae… That was actually good for you.

Obviously, that’s a big claim. Can we prove it? Just watch…

Here’s a function that adds two numbers -

add a b = a + b
add 1 2 => 3

Now watch me turn it into a function that adds 42 to any number it gets

f42 = add 42
f42 8 => 50

Slightly interesting, but not very (that’s called Currying btw - ie you give a function some of its arguments but not all of them and get a new function that has stored those arguments - they are now pre-set.) Here’s a better one:

quadratic a b c x = (axx) + (b*x) + c
quadratic 4 2 1 9 => whatever
f = quadratic 4 2 1
f 9 = same whatever

You can make more than one curried function from the same base function:

g = quadratic 11 2 7

And you can do this

f map [1..10] => lots of results
g map [1..10] => lots of results

And even though we haven’t defined any type signatures for the above, Haskell has still deduced them. So the following is a compile time error:

f “cat”

But, as they say, wait - there’s more! This is how easy it is to define a “class” that does maths for fractions (this time I am writing type signatures for extra control):

data Frac = Frac {num::Int, denom::Int} deriving Show

frac::Int->Int->Frac
frac num’ denom’ = Frac{num= div num’ gCD, denom= div denom’ gCD}
where gCD = greatestCommonDenominator num’ denom’

fracAdd::Frac->Frac->Frac
fracAdd a b = frac num’ denom’
where denom’ = (denom a) * (denom b)
num’ = (num a) * (denom b) + (num b) * (denom a)

fracSub::Frac->Frac->Frac
fracSub a b = fracAdd a (fracNeg b)

fracNeg::Frac->Frac
fracNeg a = frac (-1 * (num a)) (denom a)

fracMul::Frac->Frac->Frac
fracMul a b = frac num’ denom’
where denom’ = (denom a) * (denom b)
num’ = (num a) * (num b)

Here’s an example

frac 1 4 * frac 2 3 => frac 1 6

…Ie 1/4 * 2/3 is 1/6

And the cool thing is I can now code, without any more fuss, this -

f (frac 1 4 * frac 2 3) * g (frac 1 2) => whatever

Yes, it’s that insanely simple. You get all the refactoring and debugging advantages of strong type checking and generics without crazy verbosity. And not only that but Haskell can be compiled and run at Java speeds but can be used at a REPL.

Interested?

That was the demo: read on if you want a fast tutorial followed by suggestions for books and more online resources.

Contents:
Demo
How to use GHCI (one hundred words or less)
Functions
Lists, strings, and tuples
IO
Data structures
Maybe and >>=
Modules
Some useful libraries
More resources

1 Like

This thread is fascinating! I’ll chime in as a (relative) newcomer, though it seems the discussion has taken quite a technical turn :smiley:

I think this is absolutely true.

Often, what makes a company adopt a language for a given project is the passion of its engineers advocating for that language. For example: in my last company, I saw a (gradual) shift from PHP to Scala of all things due solely to this passionate advocacy. I’ve seen the same thing separately happen with Rust.

In other words, it’s bottom-up. People are excited to use it. They want to use it at work, not just for personal projects. They make a case for it and push for it, usually with one-off projects at first, but then other engineers see the results and want to work on those projects, etc.

As a newcomer, I can say that this was a big problem for me, at least. This is pretty much the first question a user needs to answer, before even learning the language: “how do I start a new project?” There was (and is still) no clear best answer. And making the decision required context which, as a newcomer, I did not have.

As a newcomer, it seemed to me (after doing a lot of research) that Cabal and Stack were both broken in slightly different ways. Trying to understand the trade-offs there led down a rabbit-hole which I still haven’t fully come out of :smiley:

Ultimately, from this alone, I was not left with a good first impression of either the Haskell tooling ecosystem or the community. Fragmentation of both tooling and community may be somewhat inevitable… but as a noob, it wasn’t something I wanted to be thrown into head-first.

TL;DR: Newcomer pains

The biggest hurdles for me to adopt Haskell personally were (and still are!): tooling and documentation. My experience getting up and running with a working build system and language server was bad enough that, if I didn’t really really want to use Haskell, I would have given up.

I wound up writing documentation for myself about setting up projects, common programming tasks, etc, because I didn’t find anything comparable.

TL;DR: Newcomer pleasures

On the flipside, the thing that got me started and helped me over my initial hurdles was the book Get Programming with Haskell by Will Kurt. I personally think the Haskell ecosystem needs more of exactly this type of book.

  • It’s practical and project-based.
  • It explains abstract language features in concrete ways, tied first and foremost to actual problems you need to solve in a given project.
  • It suggests one build system (in this case, Stack), and shows you how to use it and enumerates its pitfalls.

Unfortunately there are aspects of it which are already getting slightly out of date. To be clear, I still would (and do!) recommend this book to any Haskell newcomer. But it’d be great if there was something similar to this that was regularly updated/maintained by the community. (I would also love a sequel of sorts, aimed at more advanced or larger topics/projects: building web apps or what-have-you.)

Maybe the Haskell foundation can strike a deal with Manning or something :smiley:

10 Likes

I hadn’t looked at the getting started documentation and took a look through it again with fresh eyes. Comparing it to the Ocaml getting started page, which I just looked through here Installing OCaml · OCaml Documentation

  • Installing, which the Haskell docs do a good job of covering
  • Setting up your editor, which I think is fine in the Haskell guide as well

From there it’s quite a rich and slanted scale for Ocaml:

  • A tour of Ocaml gives an overview of most of the syntax (recursion, iorefs, records, exceptions, …)
  • Your first Ocaml program
    – Covers opam and dune which are two different tools that get used to manage packages
    – Shows how to use watch mode
    – Covers modules
    – Metaprogramming
    – Building an executable

I could take that and give it to someone with a background in any programming language and expect them to be able to be productive. If we had something similar that took someone through a cabal or stack project initialization, through the major syntax and to an executable I think that would serve equally well for Haskell.

There’s a lot more like exercises and guides and books, but those things would be significantly larger investments of time.

2 Likes

Again as a newcomer, I have to say: this is a fantastic summary. If slightly painful to read :smiley:

You have no decent quick introductory tour that SELLS the language.

Related to this: initially, I wasn’t really sold on Haskell being viable for my needs until I stumbled across State of the Haskell Ecosystem. This is by no means “quick” (nor is it up to date), but reading its sections on, e.g., Maintenance and Single-machine concurrency and Types (among others) left me feeling super-excited and ready to dive in. I was PUMPED for Haskell after that.

And as a major bonus, it also links to common libraries and frameworks in the domains it describes, which really helped me with discovery. In other words, it gives both the WHY and the HOW to use Haskell to achieve actual programming tasks. And again, maybe most importantly: it got me excited!

That kind of thing is sorely missing from any official pages/docs, IMO.

6 Likes

We have to understand the path you came from:

  1. how did you install the tooling?
  2. what were the first pieces of documentation that you were exposed to?

For example: ghcup installs both cabal and stack, but clearly favors cabal:

I see that the haskell org Get Started guide is a bit vague on the choice and basically just says “you can use either”.

What made you invest research on the difference? The truth is, they are to some degree interchangable, so there’s not much point in investing time in that decision.

2 Likes

To me it is appalling that with so many posts nobody has mentioned AWS or GCP. From a backend/systems/data engineering point of view currently working in Google Cloud, there won’t be Haskell adoption in the commercial user base if I cannot store a file in cloud storage, query bigquery tables, send PubSub messages, validate JWT with Identity Platform, etc. Those are big enhancers to productivity and what needs to be built in a typical start up. Once the glue of several subsystems is a commodity then you can use Haskell to its core strength, business domain modelling and higher abstractions. But If I cannot get events out of PubSub or Kinesis, using FRP libraries are out of question to make an example.

4 Likes

I’m not sure what you’re saying. Are you saying there are not Haskell libraries for AWS and GCP? I don’t know, but at least amazonka claims to be a “Comprehensive Amazon Web Services SDK”. (I’ve never used it.)

3 Likes

Are you saying there are not Haskell libraries for AWS and GCP?

I was confused as well, because the comment does read that way. I’ve generally been impressed with amazonka, but I notice that @tonicebrian has recently been fixing examples and documentation for gogol, the GCP equivalent, so presumably he feels that it’s unsatisfactory and a major blocker for commercial adoption.

4 Likes

“should happen without an new factor to cause it” and “it can happen” are two completely different statements. So, no, I have been not arguing that it “should happen without an new factor to cause it” and you have failed to provide evidence for me doing so. Just like you will fail to provide evidence for your other claims about me (for some reason), like me thinking that something should change (nowhere to be found), me wanting any change (nowhere to be found), me expecting a change (nowhere to be found). I’m done here. But to your credit, at least you have answered my question, along with other things that have been bothering me for a long time (like why undefined is not a function and NullPointerException are still with us). It’s because the marked deemed so. And I always thought it’s because of early universe quantum fluctuations.

I suggest to disengage from this back and forth as it risks escalation, and focus on (positive) ideas and improvements instead.

4 Likes

Amazonka is fairly complete (it’s mostly generated code from official AWS service definitions) but there are some deficiencies in that generator which I’ve not had time to fix. Those deficiencies have prevented us from picking up many recent AWS services and newer APIs for existing services. But for core stuff like S3, EC2, Lambda, etc., it’s very solid.

5 Likes

Yes, I’m saying exactly that. I don’t know about amazonka but I’ve been working with gogol lately and it is far from their Python or Java counterparts.

1 Like

Great post…

and these look excellent, thanks! Added to my personal map.

As a newcomer, it seemed to me (after doing a lot of research) that Cabal and Stack were both broken in slightly different ways.

For anyone else curious, the stack brokenness seems to be that it provides a worse experience in HLS (compared to when HLS is using cabal).

2 Likes

Haskell not being for everyone is a feature, not a bug. So I agree with the people who say we should focus on finding the people it would appeal to.

It’s hard, weird, requires a certain type of hacker industriousness [1], principled, and for-its-own-sake. It reminds me of a lot of niche high skill hobbies I’ve come across. A lot of people wash out trying to get into those sorts of things, and that’s fine!

[1] This is not due to some tooling gap. It’s a cultural thing that is imo now core to Haskell.

5 Likes

What are you missing in gogol compared to Python or Java?

1 Like

It’s not a question of “opposing Ada-fication” but of…

  1. Not having millions of dollars available to pay for it. First the language would need re-engineering not to use GC…
  2. And then, sanely, such a language is unlikely to come any closer to Haskell than Rust already has.
  3. Then you’d need a marketing campaign to break into this sector - note that Rust has had about zero success breaking in during the last 15 years.

You seem to think that lots of things that super intelligent, well funded people have spent years attempting without success are easy. No!

1 Like

I don’t understand where you’re coming from, and friends have suggested I go on a posting break.

To large defense contractors, millions of dollars is often not real money, and Anduril’s recently picked up a VR contract from the US Army (shades of both Luckey’s Oculus Rift and SimulaVR) valued around 20 billion, and are working on Golden Dome (estimated cost: 160 to 800 billion), the American BMD program, with Palantir and SpaceX.

Hard real-time is already a solved problem for Haskell with at least the Copilot route (Haskell churns out C code), Linear Haskell is simply something that needs work.


For Haskell in general, Haskell has the problem of being a general purpose language whose special niche (high-safety programming) is not often in high demand. Especially when you consider success at all costs & avoid, Haskell is under-resourced, the Python PyPI repository, as a reference point, has a labor value estimated between 70 and 150 billion dollars. The CoCoMo estimate for GHC is around 50 million.

Yes: these people have vast budgets. But Palantir and SpaceX know Haskell exists and they are not using it! And they show no interest in doing so. This industry has not done more than sniff at Rust yet: they’re not going to spend money on the (probably impossible) task of creating hard real time Haskell. If you want to understand how this industry really works…

I expect Rust to have made serious inroads into the defense & aerospace industry no later than 2050.

Because

The industry momentum far, far outweighs any amount of regulatory paperwork that would be needed. For companies like this, paperwork is their bread and butter. If one really wanted to make a jet that ran on Rust, they could do it. But they’d be going it alone, because their subcontractors don’t know Rust, the programmers they have working on other projects don’t know Rust, their middle management thinks it’s a video game, and their upper management thinks it’s something you don’t want to find on a jet. Which raises the issue of who , exactly, is advocating for writing their jet software in Rust?

And that’s a language that already exists, not a version of Haskell that may be impossible. And it gets worse -

Unfortunately in the safety critical space, automotive, avionic, etc adoption is hindered by all manner of requirements to meet all kind of safety standards, approvals and processes. One presentation I found discussed all this and how pretty much all such regulation was built around C and C++.

Copilot is written in Haskell. It is NOT Haskell! No one needs to learn Haskell to use it. It’s just one of many compilers that produce code that could be used for a certain range of tasks instead of C - one of dozens just for stream based coding, which is its niche. You could write a C compiler in Haskell… But it wouldn’t lead to more people coding in Haskell: they would be coding in C.

As for Linear Haskell… Is it even claimed to be for real time systems? Not that I can see from any of the docs online.