my singlepass c compiler (for a WIP blog post) is at 462 lines and I only have room for one of these, which would be more interesting?

(it already supports ints, pointers, arrays, if / while / do / for, functions, typedefs with the ~lexer hack~, and a few other things! goal is < 500 lines)

#blog #compiler

floats
60%
strings
40%
Poll ended at .
summing together the votes from birdsite and here, strings won 29 to 18 (out of 47 total votes). sorry mastodon! because i love you more i'll try to still add an addendum about how to add floats, as an exercise for the reader :-)

i've also finished implementing strings and the compiler ended up as *exactly* 500 lines 🙂

time to write a literate programming environment to explain this whole thing, hopefully it won't take 20k words...

@vgel Just read the blog post and loved it! I've been thinking of writing a C compiler + linker in JavaScript (running C code, client-side in a web browser seems fun) but needed a good entry point.

I also like code golf so maybe I'll see what I can cram into that python implementation.