Remix.run Logo
▲ pmkary a day ago

There is this memo video of S. P. Jones that famously says "Haskell is Useless". I love Haskell, but I wished it was universal like C, C++, JavaScript, Rust, and C#. By that I mean: It could be used to create apps for desktop, mobile, and web. JavaScript can be used to do so many things like power the entire web, be on node and let anyone create cli and share the code with web, and mobile through React Native, on desktop with Electron and its alike things, it lets you do plugins for god knows how many things, it lets you write things for the GNOME Shell... C and C++ are perhaps behind everything in the world and string theory finally gets seen will see they are written in C. And they can be compiled to Web and almost everything in the world. Rust is a placeholder for the two, and C# reinvented itself when it saw Mono and now works even in the browser. Each time I see Haskell I wonder what else can I do rather than creating CLI apps, and it makes me choose something else that grants me more code reuse and interesting applications.

If I could have a vision for Haskell, it was for it to be useful. Academic research and making compilers is cool, a few cli things here and there are cool too, but why can't we build music players and game engines and flutters and web pages with it? The language is way more elegant and beautiful than all the JS/C like languages out there and I really wished I could use it for the things I did. I'm aware of Servant/Yesod/IHP/Miso/Reflex for web, GTK/Monomer for desktop, TidalCycles for music, SDL/gloss for games, and various FFI/plugin, but none of them feel as coherent and worked on as the others, none of them are polished. Haskell surely needs good DX, but it also needs really better reasons for existing.

▲pbrowne011 a day ago | parent | next [-]

> There is this memo video of S. P. Jones that famously says "Haskell is Useless".

I think that is an unfair characterization of the video and the intent of Haskell's co-creator, based on the rest of your comment. Simon Peyton Jones makes a graph with two dimensions, useful/useless and safe/unsafe. The question he gets at is: how can one distinguish between effectful and effect-free computations in a programming language? He proceeds to characterize most useful languages as unsafe, and Haskell as useless but safe. He then spends the majority of the video talking about how useful languages are becoming safer, and at the same time how Haskell must become useful.

https://youtu.be/iSmkqocn0oQ

▲raddan a day ago | parent | next [-]

I've loved this video for years, primarily because of SPJ's willingness (and excitement, even) to talk about Haskell's shortcomings. I think SPJ and other important people in the Haskell community are keenly aware that Haskell appeals to a specific demographic and that, to survive as more than just a research plaything, that they need to broaden participation.

The famously friendly "Learn You a Haskell" book features its first "helloworld" program deep into the middle of the book, _after_ functors and (if I recall correctly) monads. It takes a very special beginner programmer to push that far through, working in the REPL, before they can write programs that do basic I/O.

I teach functional programming to college sophomores and juniors, and I would love to teach them Haskell. But I have to meet them where they are, and it would be difficult to do in Haskell. This is why we have taught either F#, Scala, or LISP over the years. F# in particular has a lot of the aesthetic qualities of Haskell while allowing impurity or mutability escape hatches without too much trouble. If somebody has truly beginner-friendly Haskell resources, I would love to hear about it-- I'm apparently not smart enough to chart that path myself.

▲axman6 19 hours ago | parent [-]

I used to tutor at the Australian National University, where the first semester CS course is 100% Haskell, it it was absolutely the right choice. People who’ve programmed before are at very little advantage over students who’ve never written a line of code, and often it’s the ones who did well in maths in high school that do best with it. It teaches many important ideas in a way that doesn’t give you an escape hatch to do bad things. I think for a CS degree, the primary goal is not to teach students how to program in the languages they’ll use in industry, but to teach them the ideas they’ll be able to apply to _any_ language they use in the future. I’ve also spent most of the 15 years since I took that course working professionally in Haskell, so it’s not like it’s “useless” for everyone.

▲raddan 2 hours ago | parent [-]

I have colleagues at institutions who teach LISP-like languages (Scheme, Racket) to incoming first-year students. They name the same benefits you do, and trust me, I am onboard for functional programming as a first PL generally. But I am curious whether you know how successful your program was in "outreach". Our CS1 course uses Python, and students implement a game (inspired by Pokemon). They find it very exciting, and for a lot of them, the "computer very literally does what you say" is a revelation to them. I would worry about losing some of that switching to Haskell. I'm not saying that it's an impossibility. The main obstacle in my department would be that only a handful of the faculty even know more than a few languages.

▲rramadass a day ago | parent | prev [-]

Great video! Thanks for the link.

It is important to clearly understand that Simon uses the word "useless" in the sense of having no side-effects on the external world i.e. if state changes are not reflected in the external world at some point then there is no practical purpose to it and hence "useless".

Functional languages solved this by using the type system at different levels to combine both effectful and effect-free computations cleanly.

▲petra a day ago | parent | prev | next [-]

It's really hard to be the best at every platform, and at every problem area. Especially at the start. But once you have dominance in some niche, that may give you the power/possibility to dominate other niches.

I think this article tries to figure out where can Haskell be the best.

As for a platform? If Haskell can offer the most secure, correct, and trusted web apps(the biggest platform), created with the help of LLM's, and they can use LLM's to make reading Haskell intuitive, that's a good place.

▲epgui a day ago | parent | prev | next [-]

> It could be used to create apps for desktop, mobile, and web

Haskell can 100% be used to create all of these kinds of apps.

▲flossly a day ago | parent [-]

But expect to be in pain when not web.

▲epgui 20 hours ago | parent [-]

It’s unclear to me why that would particularly be the case with Haskell.

▲the__alchemist a day ago | parent | prev | next [-]

It sounds like it needs foundational libraries? Or is it something else. For example, almost everything I write requires one or more of:

  - Embedded toolchain and/or HAL/register map for my MCU family or CPU arhitecture
  - A GUI library and/or basic I/O interaction library (keyboard/mouse to start)
  - A GPU interaction library
  - A web framework (Not going to roll my own DB interface, auth, user system, router, template system etc)

(Etc). I.e., some core library which handles the drudgery I can build my application on. If this is what you're getting at, this suggests a plan of attack!
▲chriswarbo a day ago | parent | next [-]

Pretty sure those all exist; e.g. at work we use Yesod and Servant, which are a couple of Haskell web frameworks.

▲jose_zap a day ago | parent | prev [-]

Embedded toolchain and/or HAL/register map:

- Copilot (by NASA)

- MicroHs — for running Haskell on an MCU

GUI library and/or basic keyboard/mouse I/O:

- Monomer

- sdl2

- gi-gtk4

GPU interaction library

- OpenGL bindings

- vulkan bindnigs

- Accelerate — numerical GPU computation with an NVIDIA backend.

Web framework with database access, auth, users, routing, and templates:

- IHP

- Yesod

▲txdv a day ago | parent | prev | next [-]

whats holding you back? buy claude pro and make it reality, hell im gonna give it try because your comment offends me

▲Y_Y a day ago | parent | prev | next [-]

> Functional programming should not be viewed as a tuxedo that we dust off and use when we want to be "fancy programmers." It's simply a tool in the toolbox.

https://news.ycombinator.com/item?id=15486063

▲gavmor a day ago | parent | prev | next [-]

So what's missing? GUI libraries?

▲epgui a day ago | parent [-]

Nothing is really missing, Haskell can do all of that.

▲gavmor a day ago | parent [-]

I thought so. What's the reason for the PR problem, then?

▲raddan a day ago | parent | next [-]

I can only speak from my own experience, but expressing a program as a composition of pure functions, where effects are carefully managed, is a challenging way of thinking at first. The imperative approach really is simpler to wrap one's head around _until you start worrying about correctness_. I think many developers never really care that deeply, so Haskell never appeals to them. You really do have to take a mathematical approach to program construction. I personally think that the mathematical perspective is liberating, but it's not an easy one to cultivate.

▲tome 7 hours ago | parent | next [-]

> The imperative approach really is simpler to wrap one's head around

I've devised a way of programming imperatively in Haskell but in a way that maintains all the benefits of the type system ("make invalid behaviours unrepresentable") but I don't think that moved the needle on Haskell's popularity...

▲epgui 20 hours ago | parent | prev [-]

I wouldn’t call imperative programming simpler. I’d say it’s more familiar to most people, because it’s the first thing they learn, and it’s hard to unlearn things.

▲ a day ago | parent | prev | next [-]
[deleted]
▲epgui 20 hours ago | parent | prev | next [-]

I mean, everyone who learns programming learns a fortran/C family language.

So Haskell is asking of them that they unlearn most of the things they’ve learned. It’s unfamiliar, and people react in a hostile way.

In reality, objectively speaking, it’s a very fine language to work with.

▲ a day ago | parent | prev | next [-]
[deleted]
▲whateveracct 18 hours ago | parent | prev [-]

dumb people are loud

▲ a day ago | parent | prev [-]
[deleted]