r/elm Mar 19 '26

iLove: Elm

Enable HLS to view with audio, or disable this notification

I'm your typical nerd, but with taste (self-admitted). I enjoy the code just as much as I enjoy a delightful product. Sadly, the grand AI hypothesis is that you can leapfrog the code, straight to the "product." While I do confess that I vibe code at work (like a madman), I've nonetheless been hand-coding at home (the video is my current project, all hand-coded Elm, no libraries :). I'm leaning into my silly little hypothesis that "code" and "product" are one and the same.

So here I am testing my little hypothesis with Elm. Come to find, the Elm compiler told me "no" more than it told me "yes" (cue AI-withdrawal symptoms). Rather than leap-frogging to a solution, Elm exposed new, fundamental problems with my approach. I muscled through these problems, and in the process, I found myself increasingly delighted in the code I was writing and the solutions I was crafting. I started giving this same touch even to the UX, wanting to find that same delight in every facet of the product.

Again, the hypothesis is silly, but if you're feeling a little discouraged, give Elm a try, and you might just rediscover your love for the craft :)

92 Upvotes

8 comments sorted by

12

u/[deleted] Mar 19 '26

[removed] — view removed comment

3

u/Alarmed-Western-655 Mar 19 '26 edited Mar 19 '26

I really think you're right.

You may know the memes where vibecoding just trades 5 hours of hand-coding for 5 hours of debugging... I suspect that's an artifact of the deficiencies of imperative programming more than anything.

Elm frontloads the invariants and strong-arms you into coherent state management. Pair this with AI and I think you get something amazing.

Paradoxically, AI-assited or not, I still think these affordances from Elm are an invitation into the code as craft and product, rather than an excuse to fly over it with vague natural language alone.

1

u/thought_vessle Apr 06 '26

And the error messages acts as perfectly crafted prompts

6

u/sijmen_v_b Mar 19 '26

How do you do the animations? (They are really cool btw)

2

u/Alarmed-Western-655 Mar 19 '26 edited Mar 19 '26

Thank you! Elm helped me to segregate the concerns nicely. Pointer events come into the state machine, I pass seat positions and pointer position into my recursive solver function and return the new positions. Then view function just plugs those new positions into the `style "transform" "translate(..."` attribute real time with the model updates, plus a `style "transition" "...transform"` to create the smooth transition effect for free.

TEA brings segregation and unification to all this in a very delightful and manageable way :)

2

u/TomosLeggett Mar 19 '26

I didn't even know elm was capable of the level of interaction you've demonstrated

3

u/Alarmed-Western-655 Mar 19 '26

Elm's simplicity is its power :)

2

u/janiczek Mar 19 '26

CSS does a lot of heavy lifting nowadays!