Thread with 8 posts
jump to expanded postthese last few weeks, @lynn and me have been working on a c compiler for uxn, based on rui ueyama's “chibicc”. it's been a lot of fun! it's such a cute little vm… assembly for this tiny stack machine involved so many little puzzles.
i made a demo https://github.com/lynn/chibicc/blob/uxn/examples/star.c :3
there are a number of important limitations, but it's already usable enough to write small games and demos. with some effort, it's even possible to port some existing software! i've managed to get a certain classic app working in it. i'm hoping to announce it soon :3
@hikari Whenever I can, in the morning usually, I go over the changes you two made over chibicc. It has taught me a lot. I really appreciate you working on this, it even helped me elucidate a few questions I had about how C worked.
@neauoire thank you! i'm glad it's been so interesting. re: how C works, one reason i've enjoyed this project is that i've been able to practically apply a lot of my more obscure knowledge about C… for example, the rules about what type (signed)a + (unsigned char)b
should use
@hikari Where do you get the answers to these sorts of question, do you have a sort of reference? If so, could I have a link to it?
@neauoire a lot of this stuff i've just gradually accumulated in my head over time so i don't know how i first learned most of these things, but i do have references i use to check my knowledge:
the C standard isn't available for free, sadly, but you can usually find a copy of the last draft before a particular published version
https://en.cppreference.com/w/c is the best online C documentation I know about
@neauoire my power is really in knowing what info exists, and what it is called, so i know what to look up. i know some magic keywords, like “usual arithmetic conversion” and “integer promotions”