by rui314 · 7y ago · 0 comments
Since I'll be using the new one as a reference implementation for a book, and the book is intended to be for beginners, I put as much effort as I can into improving the readability of the code. In particular, not only the head of the repository but every commit in the repo should be readable, so that readers can easily understand how each feature is implemented. I believe I'm doing a good job keeping it clean so far. (Actually in order to keep the commit history clean, I continue rewriting commit history and doing `git push -f`, but that should be fine because the purpose of publishing the repo is not for co-development but for sharing a reference implementation.)
chibicc does not have a C preprocessor, but except that it can compile itself already, so if you are interested, you can take a look.
I would love to see a similar book/project for a linker and assembler.
(Actually in order to keep the commit history clean, I continue rewriting commit history and doing `git push -f`,
actually I wonder if you might consider to maintain another clean repository. So there is a raw repository to record every real history, and a clean repositiory to for better reading? Because sometimes the raw history could be interesting too.That said you could always turn off gc if some people want it, but I wouldn't put any more than a token effort into keeping that history.