“Halogen is better at almost everything”

Compliments to Halogen by @chrisdone on this twitter thread:

16 Likes

Nice to see some love for Halogen!

I’ve used Elm for quite some time on personal projects, and have to work with React regularly in the office when consulting.
I’ve only dabbled a little with Halogen so far, but I’ve already reached the point where I’d prefer it to Elm as well!

3 Likes

I was looking for this post recently, but Chris has deleted his Twitter so it’s gone.

On a hunch, I just checked the Internet Archive, and they have it! So if anyone else is looking for the OG thread:

I’ve been working on a codebase that uses TypeScript on back-end and PureScript + Halogen on front-end (don’t ask why - it’s boring), and Chris is right.

Moreover, I believe TypeScript is harder than PureScript to learn, as while the initial learning curve isn’t as steep there are so many corner cases and gotchas it takes years to learn all the inconsistent-seeming behaviour.

TypeScript’s type system reminds me of this analogy about PHP. You pick up union types and they work okay, until hours into debugging a weird issue you realise unions aren’t exclusive. You pick up Enums and they have all these weird gotchas. You think types will stop your code exposing object properties it shouldn’t, but then you realise TypeScript doesn’t have those guarantees. You think some const is of type A but no, it’s something completely different because you used <A> in your code and the semantics of <> are confusing; is it a cast? Is it like function brackets, but for type arguments? It’s both, and more!

That said, the developers of TypeScript are brilliant engineers. I think most of its problems stem from being a superset of JavaScript.

In comparison, PureScript has a much steeper learning curve at the start. But once you get it, PureScript is very consistent.

6 Likes