JavaScript became more than code: a culture, a dynasty, a paradox. In the shadow of this legacy, a bold team embarked on an athletic, and deeply inspiring adventure: rewriting everythingā¦
For over decades, web developers have lived in a loveāhate relationship with JavaScript, and this has affected their own sense of community, with internal disagreements turning into verbal altercations, sometimes brutal and cruel.
These are the facts. We criticize it, we mock it, we reinvent it, and yet, we often (if not always) come back, partially or not.
Because, deep down, the web is JavaScript (or almost): the lingua franca of the browser, the keystone of everything that runs inside a tab.
And yet⦠between the endless undefined is not a function, the inconsistent APIs, and the jungle of an evergrowing ecosystem (which can sometimes be overwhelmed by his proposals), itās hard to find a line of reasoning that makes lasting sense.
So we look for escapes: CoffeeScript yesterday, TypeScript today, Elm or Reason for the boldest.
And now⦠thereās PureScript, a quiet language (but one of rare elegance).
I know I know, you may be suffering from JS fatigue, like I was (āoh, more promotion from an official team member, infiltrating dev.toā¦ā), and youāre thinking that itās irrelevant to come up with yet another thing in this saturated universe.
But.
I am a freelance developer, and I do not do any promotion.
Thatās when things start to take a turn toward something completely different. Itās not just a thing, a tool, a framework, a bundler⦠or even a mere language. Itās a parallel universe, both independent and connected, which stands on the shoulders of profound epistemological mathematics. Weāll get back to that.
JavaScript, the Dynastic Dystopia
Letās face it: JavaScript has won.
It reigns over the web like a dynasty: (almost) uncontested, omnipresent, eternal.
From browsers to servers, from build tools to mobile apps, a lot of things eventually bends to its rule.
But itās a dynasty with a dystopian flavor: a vast, prosperous empire, yet inherently unstable.
Each new framework promises order and simplicity, but also sows significant additional chaos. Nothing seems to be completely resolved. This is probably what contributes to such dynamism, but it is also what can unnecessarily exhaust some people.
Dependencies multiply, paradigms collide, and peace always seems one npm install away.
You canāt leave this empire, the web is its territory. It holds up, and it does the job, which is no small feat (far from it). And no one is rude enough to claim that there isnāt wonder in many places within this ecosystem.
So what remains?
The art of navigating it: creating your own bubble of confidence, and diving into it fully, without fear.
Thatās where Purescript comes in.
PureScript: Haskell for the Great Web (and more)
PureScript is a purely functional language (strongly) inspired by Haskell, compiling down to plain and optimized JavaScript. As such, it encapsulates all the power of Category Theory (remaining dev-oriented), and still can run on browsers, desktop (e.g. Electron), backend (Node), etc.
N.b. Because the subtleties of Node's Event Loop are misunderstood or disliked by non-JS devs, Haskell is sometimes preferred for backend purposes. PureScript has now made these subtleties much easier to handle.
In practice:
- Strong static typing, everything is checked before runtime. Functional purity, no hidden side effects.
- Readable, efficient output, no black magic.
- Powerful type inference, the compiler often knows your intentions before you finish typing.
- Algebraic data types and pattern matching, express complex logic elegantly and safely.
- Effect system, explicit control over side effects, concurrency, and async behavior.
- Extensible records and row polymorphism, flexible data structures without sacrificing type safety.
- Typed foreign function interface (FFI), seamless bridges between PureScript and JavaScript.
- Ecosystem synergy, works hand-in-hand with frameworks like Halogen, React Basic, or Concur.
- Small, composable abstractions, build large systems from simple, predictable parts.
- Mathematically grounded, category theory isnāt decoration here; itās the backbone.
- Cross-platform by nature, browser, Node.js, Deno, Electron, Cloudflare Workers, it just runs.
- And⦠so much more. Itās another worldā¦
PureScript lets you reason about your code with mathematical precision, while still building modern, reactive, performant apps.
Itās the Hextech gem from the Arcane series, the philosopherās stone, allowing clarity to emerge from a world saturated with conflicting forces.
Writing JavaScript without suffering from it
Take asynchronous effects, for example.
In JavaScript, Promises are convenient but quickly spiral out of control, nested callbacks, silent errors, ghost exceptions.
In PureScript, effects (Effect, Aff) are described and typed explicitly.
No more partial functions. The compiler knows when youāre touching the outside world, and makes you handle it properly.
And yet, youāre still within the JS ecosystem: you can import npm libraries, use React through Halogen or React Basic, or even handcraft JS interop directly. Youāre not lost.
PureScript doesnāt flee the dynastic dystopia: it reveals islands of long-lasting structure within it, and ensures their sustainability, development, promotion, expansion, and scaling.
The Art of Compromise: Purity without the Ivory Tower
One of the most compelling aspects of PureScript is that it does not force you to pick a side.
You do not have to choose between the pure, safe, and elegant and the flexible, fast, and pragmatic.
PureScript offers a genuine compromise, perhaps the smartest one seen around this duality.
Iāll let you write everything you love about functional programming (strong typing, purity, compositionā¦), but I wonāt lock you in an ivory tower.
If you want to use JS libraries, APIs, or even write some JS yourself, you can.
Just declare a foreign import in one line.
I want you to do things because you understand why, not because I force you to.
This isnāt a weak compromise, itās a collaboration between two worlds.
You donāt sacrifice native safety or pragmatic flexibility, you make them work together through anti-corruption layers.
Thereās no need to throw away your JS experience or deny your love of functional purity.
You can do both, and this upward hybridization is deeply promising: the very best of both world is kept intact.
No downward mixing, no sacrifice, no ideological war between paradigms: just a fluid membrane, allowing the boundary to shift, sometimes to 100% PureScript, sometimes close to 100% JS, if you feel so.
Instead of turning the table upside down, PureScript ensures continuity, compatibility, and a transition without violence.
You could write X(< 100)% of your code in PureScript, and the rest in JS without guilt or pressure.
Itās a rare philosophy: a language that values not just purity, but maturity.
Conclusion: the Web as a playground, not a prison
JavaScript has become the universal runtime. You canāt escape it.
And thatās perfectly fine, as long as you can really choose how to enter it.
TypeScript tries to make JS less dangerous by adding safeguards. And we can thank it for that.
PureScript, on the other hand, comes from a different world, the purely functional one, and builds a bridge to JS. There is no interference, no hidden language design isomorphism, no subconscious mental pollution.
It took me almost 2 years to understand a satisfactory portion of these lands, even in its most remote regions. I read almost every night on this. This is not a small episode: it is an endless series, full of academic work in progress. In any case, the front door is now increasingly easier to open, thanks to high-quality courses made by enthusiasts, and what seemed impossible yesterday has become reality today.
PureScript offers a rare path to achieve your ends with JS: to harness its power without inheriting its potential chaos, to turn its flexibility in a plain quality, to create without betrayal, and to rediscover the joy of writing code where every line does what it says, and says what you think.




