Choosing My Frontend Stack
Over the last few days, I’ve been evaluating Rescript and Gleam as my go-to language for building interactive web app frontends with.
This is now the probably fifth time I’ve re-evaluated my frontend language, and I very much expect this isn’t gonna be the last.
It started all out with me not liking JavaScript as much. The reasonable thing to do probably would’ve been to just go for a JS Framework, but I .. didn’t do that.
Instead, I tried to put my functional programming affinity to use and wrote my final 42 project with Phoenix LiveView. That was.. pretty nice, especially because I like Elixir so much.
It also mostly worked so well because I could know for sure the internet would work reliably.
And that is something you cannot take for certain in basically every other project.
But I didn’t know that then.
Instead, I went and played around with my idea of a simple project app, built it in Phoenix LiveView, and found out the hard way that this is not its niche.
You either:
- stay on the server and suffer from latency
- go to the client to not suffer from the latency, but then push data from Elixir to JS and back
Not a trade-off I’m willing to make.
Then, I started my job, and there, I’m currently mostly using ClojureScript for frontend stuff, which works.
It has quite a few things I like a lot about it (Syntax, general Lispyness), but also a lot of things feel weird, or pretty much like an afterthought. ≺≻ Where ClojureScript Feels... Weird
Also, it doesn’t have a static type system, a thing I somehow especially value on the frontend.
And currently I’m in the process of accepting that since I want to build Local-first Software and don’t want to write my own sync engine (yet, who knows), I have to rely on JS libraries.
So now I’m looking for a language/framework combination that lets me write simple declarative frontends with a strong and static type system with as close interoperability with JS/JS libraries as possible.
Which now made me jump back and forth between learning Gleam/Lustre, ReScript, and PureScript/Halogen.
Well, what can I say? At least I very much enjoy learning programming languages ^^
≺≻ Things I want in a programming language
≺≻ What I Wish I Knew When Learning ReScript