Settings

Theme

What killed Haskell, could kill Rust, too (2020)

gist.github.com

52 points by envp 4 years ago · 50 comments

Reader

resoluteteeth 4 years ago

This felt a bit off but the note at the bottom explains it:

> As one might have guessed, this is not an essay. It's a transcript of the following talk by R. Martin with some substitutions made (SmallTalk -> Haskell, Ruby -> Rust, and others). You are free to make any conclusions from this.

If there's a thing that has arguably "killed" haskell and could potentially kill rust too it's probably not this but rather packages bifurcating into a million different incompatible implementations of everything because so little is in the standard library.

  • MBCook 4 years ago

    “… but rather packages bifurcating into a million different incompatible implementations of everything because so little is in the standard library.”

    This was my problem. I played with Haskell some. I actually liked it quite a bit, but I just couldn’t force myself to program in it. I’m so used to Java where you have a huge standard library. Even without that I’ve done PHP or python where the standard libraries were quite good.

    Haskell felt like a giant step back. And I know there are reasons for the way it ended up. And in many ways that makes sense. But even if you ignore all the functional programming stuff that’s new for many people it’s an incredible pain to get started in Haskell because of the lack of standard library and the huge number of extensions.

    And if you ask around you find out that lots of people don’t use Haskell without like 12 different extensions turned on. And then you have to use _these_ libraries to get anything done.

    And that’s before you get into the religious wars over if you should be using lenses or some other thing.

    As a new user, my preference would be this:

    1. Stop pretending GHC isn’t Haskell. For all intents and purposes it is the one and only implementation that matters. Just like PHP, Ruby, and Go have canonical implementations. Bonus points for renaming GHC to Haskell.

    2. Bring all the modern stuff people expect into the standard library. I’m sorry it’s been way too long to remember what’s missing, but I’m sure people who are active in the community know what the “must use“ libraries are.

    3. Language extensions are for academics. There’s nothing wrong with having them, but you shouldn’t need to mess with any of it to write good apps. Figure out what should be on by default, compile it in. No normal programer should have to mess with them.

    I feel like fixing those three things would make the language 100 times more approachable. I don’t think it would ever happen, too many people would have to agree on too many things. But I just don’t see Haskell ever going anywhere without it. The same way I don’t see Emacs ever becoming a “normal“ program that people use without lots of changes.

    It’s OK if you want to stay “obscure“ because you like the way things are done. But don’t expect to take over the world.

    • remexre 4 years ago

      > But don’t expect to take over the world.

      "Avoid success at all costs" is the Haskell motto, so...

      > Bring all the modern stuff people expect into the standard library.

      GHC already ships with lots of these, they're just not in the base package. You might find Relude [0] more to your liking?

      > Language extensions are for academics.

      GHC2021 happened and mostly alleviates this! But it's now one language extension that turns on everything that most people (on the committee) think everyone is fine with. We're not really going to see it becoming built-in without a new Haskell standard, and that (Haskell Prime) fizzled out due to lack of time from the committee members.

      [0]: https://hackage.haskell.org/package/relude-1.0.0.1

      • nsotelo 4 years ago

        It is 'avoid "success at all costs"' meaning success is good but must be balanced against other priorities.

      • MBCook 4 years ago

        That’s good to hear. It’s been a few years since I played with Haskell. I know some of it was in the works. Nice to know it came to fruition.

    • DarylZero 4 years ago

      These are all valid criticisms in a way, but not really of the Haskell language. You could literally fix all of these issues with a custom prelude and a .cabal file to enable default extensions.

      There are a lot of project templates already existing that do this btw.

      I think it isn't a big issue to most Haskell users because it's really only an issue when starting up new projects, which isn't what programmers are doing most of the time.

      • MBCook 4 years ago

        You’re right. They’re all environment problems. But they frustrate and confuse the newbie (like me).

anyonecancode 4 years ago

Haskell is neat, and is one of those things I'll regularly come back to play with in my spare time. A lot of the ideas behind it have made me a better programmer. Rust I've never touched, though it looks interesting. But:

- In my daily work, the work that pays my bills, I regularly use software built in Rust, eg ripgrep.

- About the only time I ever cross paths with Haskell is in those times when I'm going out of my way to do so as part of my tech hobbying.

I think that's an important difference

  • pja 4 years ago

    There are one or two Haskell applications you might touch in real world use without realising that they’re written in Haskell. Pandoc is the obvious one.

    • Zababa 4 years ago

      Shellcheck is the other one. I'm not aware of any others.

      • throwaway81523 4 years ago

        I use Gitit sometimes. Also don't forget Perl 6 has some origins in Haskell. I.e., Pugs influenced the final language quite a bit though Pugs itself is no longer in use.

      • hnzix 4 years ago

        In cryptoland, Cardano is built on Haskell. This does create a barrier to entry compared to say a Javascript-esque language.

ncmncm 4 years ago

Nothing sets off Rust fans quite like hinting it might still fizzle.

(Fizzling is a likely outcome for any new language, and does not suffer the mess of interpretation that "dying" carries.)

The thing is, there was a time when Ada had a lot more industry support and investment than Rust has today. OS kernels were coded in it. Aircraft and satellite instrumentation was coded in it, with billion-dollar contracts. Ada fizzled.

Erlang had rapidly growing support in the '90s. It had unique strengths. Erlang fizzled, too.

As hot as Rust is on HN, it could still fizzle in exactly the same way, for the same reasons. You might code something good in your work, but when you move on, will anybody be found to maintain it? People with Erlang skills today are most in demand to rewrite Erlang systems in something, anything not Erlang.

The rabid response and reflexive downvoting seen for anything even slightly critical of Rust betrays a level of insecurity that does not bode well for Rust.

For Rust to succeed, it probably needs at least a 10x improvement to compilation speed. That will probably require uncomfortable and difficult changes to the language and core libraries. Is there appetite for such changes among the faithful, who have come to terms with extremely slow builds already? To succeed, Rust needs to attract hundreds more for each current user. They have not accepted its weaknesses yet, and might never.

Rust needs to be easier to adopt. Rust is already as complicated to learn and use effectively as C++, but with nowhere near the level of industry support. Rust enthusiasts are little islands in the ocean; you have to go online to talk over design details, most places. It needs to not demand arcane, abstruse apparatus for ordinary things. (C++ has been good at sealing off difficult apparatus in easy-to-use libraries.)

When you think Rust must be really taking off already, consider that more people pick up C++ for the first time, in any week, than the total who are employed full time coding Rust. Rust really can still fizzle, as unpleasant as that is to consider. Vociferous advocacy is not what will save it. It needs much harder measures, that will appeal much more to people not now coding Rust than to those scattered few who already do. For now.

  • jolux 4 years ago

    > Rust is already as complicated to learn and use effectively as C++

    I see a lot of claims to this effect but having tried to learn both I found Rust much easier. It's also safe by default, which C++ isn't. How exactly do you think it's equally complicated?

    • ncmncm 4 years ago

      We all know that Rust is "safe by default". That is part of what makes it complicated.

      Most of the complexity of C++ comes from its long history, with new features layered on old, extra junk you have to say to get the new stuff, and old stuff to stay clear of. E.g., constructors should be explicit, and lots of things should be const, and you have to call std::move() to pass a value that way, and implicit conversions can happen accidentally. But actually using it, sticking to the modern bits, doesn't depend on much in the way of new concepts. Writing libraries for general use depends on deep lore, but that doesn't leak out to users of the libraries, who just get libraries that can do more for them.

      In Rust, you need to learn a whole new regime to do even basic things. And, you need to learn workarounds for what C++ does but Rust doesn't, yet. There are literally thousands of times as many people who can answer questions about C++ than about Rust, so mysteries are shallower.

      • jolux 4 years ago

        > In Rust, you need to learn a whole new regime to do even basic things.

        Sure, but the same can be said of any language that’s significantly different from C++ (OCaml, or Erlang for example). That doesn’t mean they’re as complicated.

        Rust syntax and semantics are basically ML syntax with curly braces and semicolons on top. Having already learned OCaml by the time I picked up Rust, all I needed to internalize was the borrow checker, which is simpler to appease than it first appears.

        > There are literally thousands of times as many people who can answer questions about C++ than about Rust, so mysteries are shallower.

        Again, this is an argument about adoption more than about the intrinsic complexity of the language. I agree it’s harder to find answers, but that’s always going to be true when the languages you’re comparing to are C/C++/Python/Java/JavaScript.

        > But actually using it, sticking to the modern bits, doesn't depend on much in the way of new concepts.

        I disagree that smart pointers and move semantics aren’t new concepts. But more importantly this is basically an admission that C++ is vastly more complicated. It doesn’t really matter that there are subsets of C++ that are simpler, because to be able to understand code written by other people, and old code, you will need to understand these bits. The same is not true of Rust.

        • ncmncm 4 years ago

          The overwhelming majority of what you need to learn to understand old code is what was built out of the old code. Language complexity there is a rounding error. So, the relevant complexity is what you need to understand to write new code.

          Detailed comparisons will be meaningless. It suffices that they are comparable, of similar order. Somebody coming from Haskell or an ML will have a completely different experience than somebody coming from JS or Python.

          Move semantics and smart pointers are about the same in C++ and Rust, so do not count in a comparison.

          I learned Rust a few years ago, but cannot follow Rust code examples published today. It has become markedly more complex in a short time.

          For Rust not to fizzle, literally thousands of programmers wholly unacquainted with it will need to adopt it for each current user. None of the former come bought into any of what current users have chosen to endure. To get those programmers on board, things will need to happen that most current users do not perceive as necessary, many of which they would absolutely revile, and many others they do not consider worth enough effort.

          Overcoming resistance to necessary change from current users will be much, much harder than getting the new users on board after changes. Getting enough new users on board without those changes is probably impossible.

          • jolux 4 years ago

            > I learned Rust a few years ago, but cannot follow Rust code examples published today. It has become markedly more complex in a short time.

            Interesting. I suspect this is where our experiences differ the most, I started learning Rust around when it came out and have felt it only get simpler and more consistent over time. I do not see many major differences between Rust written now and Rust written then. The biggest one is async, which is definitely a big difference.

octoberfranklin 4 years ago

This is another screed by someone who thinks Rust's success is due to marketing or branding or devs who throw great parties.

Rust is the first memory-safe language without a garbage collector [*].

That is why it is a big deal. Those are table stakes now.

Everything else is just styling and bonus points.

As for the article title: what killed Haskell was deviously unpredictable performance from large-scale programs. Haskell performance analysis is intractable for big programs. Rust's "just say no to GC" is about as diametrically opposed to that as you can possibly get.

[*] aside from research prototypes -- much respect to MLKit and Cyclone: https://elsman.com/mlkit/pdf/mlkit-4.3.0.pdf

pydry 4 years ago

There never really seemed to be much of a hacker culture around haskell. People liked to talk about it much more than they liked to build things with it.

By contrast people really do seem to love building things in rust.

  • msdrigg 4 years ago

    They might love building things in rust, but they REALLY love re-building things in rust.

    • carlmr 4 years ago

      I think this is also the result from Rust being really good in two spaces that have faced little competition before.

      Anything that was written in C or C++ before, and anything written for the web (Rust seems to me to be the only language that cross-compiles easily to WASM, and is useful in the required GC-less context).

      So now there are a lot of programs in C/C++ that people have been using for years that often cause some kind of issues, because it's really hard to get memory safety right here.

      And there are a lot of things written for the web, where people want something more sane than JS, and even though typescript already filled that hole in a sense, there is just so much space here that Rust still has little competition here.

seanhunter 4 years ago

Haskell was always intended as a research language to promote innovation in computer science rather than as a general-purpose language trying to achieve mass adoption. In fact, "avoid success at all costs"[1] was the slogan they chose to reinforce the idea that the goal was not to achieve widespread usage. I'm not a serious haskell programmer, but I would heartily recommend messing around with it for a few weeks to anyone who wants to learn more about functional programming. It will expand your mind. One of my favourite ever hacking experiences was putting together a toy relational algebra in haskell over a weekend inspired by the string and list fusion papers (never actually managed to persuade ghc to actually optimise the fusion parts properly but that's another story).

Rust appears to have an entirely different goal, which is to take everything that has been learned over the last 40+ years of practical systems programming, and make a language that provides safety, speed and concurrency and works well for teams of programmers on large projects. [2] In that sense, it really is looking for wide adoption for the sorts of projects C and C++ have been used for during that time.

In its original version (Smalltalk and Ruby), this talk always struck me as a sort of fun polemic that probably didn't warrant too much serious thought, but here it's been stretched beyond belief, so I'm pretty surprised it's being posted here. Just as an example from the first paragraph, is there really anyone who seriously thinks rust is "Haskell without higher-kinded types"? That substitution has just been made because it vaguely fits the format of the original talk, but is just wildly off-base.

[1] https://haskell.foundation/whitepaper/ [2] I'm paraphrasing here, but check out https://doc.rust-lang.org/book/ch00-00-introduction.html for their explanation

c3534l 4 years ago

Haskell is intentionally niche and experimental. This is the opposite ethos of Rust which aims for popularity and wants to be a mainstream language. They don't seem comparable at all and the parallels the author draws seem arbitrary and irrelevant.

throwaway19937 4 years ago

TL;DR don't waste your time.

This is a transcript of a Robert C. Martin (Uncle Bob) talk with some substitutions made (SmallTalk -> Haskell, Ruby -> Rust, and others). The original talk was mediocre; the changes haven't improved it.

gaze 4 years ago

I still use haskell and like it. It has a nice incremental development style, a tiny bit like lisp, where you can grow a program step by step in the repl, guided by the types. It’s great. I think I’ve been using it for long enough that it just feels comfy so I won’t be stopping. I don’t really care if it’s not popular.

neilpointer 4 years ago

before clicking: "was it insufferable nerds?"

after clicking: yes!

Syzygies 4 years ago

"The reports of my death are greatly exaggerated." -Mark Twain

AtlasBarfed 4 years ago

r/Haskell/Lisp -> same problems

The functional language conceit exists and its a problem.

It's interesting that Go is mentioned as a target of the conceit. Well, there is a LOT of important software in modern IT systems that is golang based. There has been impressive productivity from that language and its programmers, and I'm someone that doesn't like golang.

Functional languages just haven't produced something on the scale of Kubernetes, or a database, or a web framework, or... really anything. Not even something like Ruby on Rails, which is now replaced with JS flotsam/React, but was significant.

Functional languages seem to assume that you build it and they will come. It hasn't happened.... like ever. The quip is if you keep doing the same thing expecting a different outcome, then that is insanity.

What functional languages need is a significant application. Since they are (theoretically) better for multicore and we are in the age of core scaling rather than serial speed improvement, and have been for a decade... WHERE IS YOUR APP?

It has to be the IQ filter. I simply think that FP requires higher IQ people, and that filters out a massive amount of people that just want to get stuff done and go home to their families or rave. Once you get over a certain IQ threshold, then the people in that cohort actually repel other people. If you've ever been to a Mensa meeting, you should know what I mean.

I think Rust is fine, it is focused on practical goals: rewriting vulnerable C programs, improving Firefox speed and safety, etc.

  • ncmncm 4 years ago

    The only Haskell program I have heard of normal people using is Pandoc. Some people use Git-annex.

    I don't know of any Rust program many people not coding Rust need. There are plenty of rewrites of existing programs, such as ripgrep and alacritty, but neither offer compelling reasons to switch. (Grep speed has never been an issue, for me, and kitty is much faster than alacritty.)

    Rust still has no compelling usage story, such as a program that people need that would be so hard to write in some other language, instead, that no one has succeeded. (People talk up Servo, but who is using it?)

    • AtlasBarfed 4 years ago

      I am not a rust coder at all. Rust is doing a pretty big and ambitious project that isn't the typical "hey here's a new language to try". Rust goal is to be an ecosystem-mature replacement/alternative for the C/C++ toolchain, libraries, infrastructure.

      That's a biiiiiig ask. Absolutely massive. The fact that there is some Linux movement in supporting rust in the kernel shows it is largely successful. While you're right it doesn't rise up to "show me the apps" criticism, it is a big win.

      "Show me the apps" is not a criticism that you CAN write apps in it. All I'm saying is that something is culturally wrong, because the people that want to write practical, useful, mass-market software choose NOT to use functional programming, even though it has allegedly massive advantages and superiority.

      The lisp essay by Paulie guy is informative: it enabled a really smart programmer to outscale a team of programmers, but it hit its limits. It did not scale beyond that, and was, I suppose, too inscrutable to be picked up and supported by others.

      So was it Lisp that allowed him to compete for a while? Or the fact that he wrote it and knew it top to bottom and was really really smart and motivated? Probably a bit of both, I personally would argue 80% superprogrammer, 20% language.

      • ncmncm 4 years ago

        The Rust in Linux thing is a lark. Anything you might do in the Linux kernel that you might do in Rust would be much more cleanly and easily achieved in C++, if not for Linus's rabid diatribes: every single thing he criticizes in C++ is in Rust, too. The inventor of the RCU synchronization primitive the kernel relies on spends most of his time with C++.

        So, I expect Linux kernel Rust will fizzle, regardless of what happens elsewhere. Maybe Redox will get traction, or Fuschia kernel will be recoded in Rust.

  • pdimitar 4 years ago

    Wait until you find out about Elixir and its web framework Phoenix. $10 hosting, 2000+ reqs/s with 100% parallelism.

    Before you say it, it's quite popular and used already. But there's a barrier beyond which a lot of programmers just don't tread, and will stay in Python / PHP / JS regardless (while raving about how awesome Elixir is).

    My guess is market size and job security concerns but who knows, maybe some of what you say applies as well.

    • ncmncm 4 years ago

      This is more apt than you know.

      If Rust finds only the amount of penetration that Erlang has, it will have failed.

      • pdimitar 4 years ago

        I guess this will always be a contention point since the definition of "failed" is very flexible.

        I'm well aware that Erlang/Elixir are still niche, and Rust is kind of niche as well. But by what measure? Usually it's a comparison with e.g. Python, Java, JS popularity and usage. In that regard 99% of the technologies out there have "failed".

        I find such comparisons meaningless however. In the segments of the technologies I work with there are a lot of things happening, there are very good money to be made, and productivity is usually very high compared to the "successful" technologies.

        So everybody is free to look skeptically at the "failed" technologies and "wisely" conclude that if they were THAT good they surely would have displaced the mainstream ones by now, right? Hence they can't be that good, m-hm, no sir.

        I have no objection to people thinking that shallow. In the meantime, a lot of us make very good money and are not forever stuck on problems that have 20-year old StackOverflow threads. It feels really good.

        • ncmncm 4 years ago

          Failed, or fizzled, means that when somebody working on a project leaves, you can't can't count on finding anybody to hire in to replace them. Allowing anything essential to be coded in the language, then, is an existential risk for a small company or division.

          It means nobody wants you working on anything essential unless they have already bet the company on that thing.

          • pdimitar 4 years ago

            I am well aware of that adage as well. But there's mounting [anecdotal from many directions] evidence that people get very easily onboarded in Elixir (sadly doesn't apply to Rust or Haskell or OCaml though).

            So when trying to analyze this situation today, at the brink of 2022, it pays off to also add factors that haven't been there before e.g. newer tech that people can easily pick.

            I am not trying to convince you to pick a new language btw, but I find your opinions to be just parroting some common wisdom that's fairly outdated at this point. Even if its basic premise still stands the devil is always in the details, and those details favour some of the more fringe tech a little bit more compared to some mere 5 years ago.

            • ncmncm 4 years ago

              Mastering a tool that nobody else has, and that is radically better than what others are using, can be akin to a superpower. But Spider-Man and Doc Ock are not happier than other people. What they are, mostly, is alone.

              So, a niche tool may be best for you if you like to work alone.

  • XVincentX 4 years ago

    Clojure is a very good success story of a functional LISP running on the JVM.

envpOP 4 years ago

Previous discussions:

- https://news.ycombinator.com/item?id=24449927

- https://news.ycombinator.com/item?id=24401748

  • geofft 4 years ago

    Thanks, I missed this at the bottom of the gist, but it was helpfully quoted in a comment:

    > As one might have guessed, this is not an essay. It's a transcript of the following talk by R. Martin with some substitutions made (SmallTalk -> Haskell, Ruby -> Rust, and others). You are free to make any conclusions from this.

    I think that means that this isn't a serious enough argument to be worth engaging with.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection