Home Blog Projects About

Rewriting this in JS

Posted: 2026/10/10
#meta #software #javascript #typescript

If you havent heard about it yet, bun did a rewrite from zig to rust largely powered by ai. Im not particularly enthusiastic about using ai for things you actually care about if it can be avoided, so I decided to rewrite the static site generator in js. Yes, you could technically use tsc to compile and then use that, but the main reason I chose bun in the first place was to avoid that explicit compile step. I did initially dread the process, however it worked out quite well and took surprisingly little time to complete.

5 text files. 4 unique files. 2 files ignored. github.com/AlDanial/cloc v 2.04 T=0.01 s (412.2 files/s, 13499.4 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- JavaScript 3 19 6 94 JSON 1 0 0 12 ------------------------------------------------------------------------------- SUM: 4 19 6 106 -------------------------------------------------------------------------------

The actual code for the static site generator is still incredibly small, which im quite happy with. Alot of the more complex logic for things like the tag pages is handled by the Template itself.


SSG

The new rewritten code