Why I rewrote Polygon from scratch in Jai

Rewriting a Commercial Engine in Jai

Why I rewrote Polygon from scratch in Jai

After eight years building Polygonjs on three.js, TypeScript and Vue.js, the author grew frustrated with JavaScript's memory management: he couldn't reliably tell whether geometry was actually freed, and garbage collection caused frame drops. Discovering Jonathan Blow's Jai language gave him direct control over allocation and performance. He rewrote the entire procedural engine, including a new renderer on WebGPU/wgpu, and Polygon v2 is now released.

If a test suite cannot tell you where you have a memory leak, or even whether you have one, you are running blind.
  1. program_whiz

    My comment on Jai is that it is a language with some conveniences, but ultimately no strong reason to favor it. Similar to zig, odin, and others, its basically just C with some syntax conveniences.

    It has some design choices that I appreciated at first, but are really strongly suited to a particular way of writing games, and I wouldn't call it general purpose (those same design choices are very limiting in other domains).

    I do appreciate compiler speed, but ultimately I bounced off of it because the slight improvement in syntax doesn't justify losing massive tooling, libraries, docs, support, etc.

    The language is also quite quirky in its conventions, which I think is due to Jon Blow's style, but which can feel quite odd to anyone who has a wider breadth of programming (than just custom game engines).

    Also of course, any contributions or suggestions are met with the typical JB politeness and charm :)

    All the flaws people mention here, are simply because you just don't get what a genius he is, those are actually features!

  2. Twey

    JB's original claim, at least as I understood it, was that with LLVM and the like language tooling is now good enough that anybody can quickly whip up a language to their personal tastes with no PL background, and therefore the hurdle of novelty and generality required for a language to justify its existence is drastically lower than it has been in times past. It's a shame, but having his personal language be in closed beta twelve years later is pretty strong evidence against that thesis in a couple of different ways.

  3. manuisin

    I’d love to try this out. But the SDK can’t be used unless one first signs up to Jai beta?

    Had few other questions:

    - Is the dev environment still web first or is that a secondary target?

    - One of the best things about three.hs is the extremely fast feedback look with HMR where if setup properly you can code see changes reflected in your running app without a refresh or losing state within a second. Is something like that feasible here?

    - How complete is the PBR support?

    - Lightprobes or lightprobe grid supported? I know that’s just mostly material/shader related code so shouldn’t be impossible to add based on a project’s requirements.

    - I didn’t see support for skeleton meshes in the examples either, is that possible?

    - Also, how feasible is WebXR support?

  4. frading

    This is a recap of the reasons that led me to bite the bullet and rewrite an engine I used to sell and ship commercial projects.

  5. matja

    Is there a manual for Jai, or some info on how it compares with other languages? I find it hard to find resources on it - there's no Wikipedia page, and my web searches list some videos and random github projects?

More from this day

2026-10-25