Lets look at the breakdown...
The self hosting commit:The final commit to self hosting was support for C va_lists, just enough to compile the code used in the compiler itself.
~ 188 days of self directed work.
Commits:Approximately 380 commits, though probably more, because I discarded lots of work in local branches. I estimate a commit to be 20-30 minutes of work on average, so that translates to about 4 work weeks of hard work actually coding.
I worked whenever I could take a break, including evenings and lunch times. Sometimes I couldn't sleep and would still be hacking away at 3 am. Once I woke up at 6 am, probably to fix a bug that was giving me nightmares.
Lines of code:5902 lines of code currently, but will grow. My original goal was a complete toolchain in less than 15k lines of code, and I think I have still have room to spare for an optimizing backend and assemblers.
Code quality/clarity:I think I have done a good job, though there is always room for improvement. I really wanted to make something anybody could understand. It is a matter of opinion, but look for yourself.
Compare my for loop parser:
To the equivalent clang for loop parser:
To the equivalent gcc parser:
To the equivalent Tiny C compiler parser:
Motivation levels:I am unfortunately the type of person who constantly starts new projects and stop before they hit a major milestone. I eventually reached a point where I felt like a failure, and that I couldn't finish anything. Overcoming this can be a struggle, but in this case I challenged myself to not be a quitter. Whenever I hit a brick wall and wanted to give up, I told myself that this barrier would stop someone else, but it won't stop me.
My motivation levels did drop at times, but I picked myself back up every time to reach this milestone.
The future:My crazy ambition was to write the cleanest C compiler that could be used for an all C operating system like plan9 or Openbsd and there is still lots of work to do to reach that level of sophistication. Real OS support will require funding or many more dedicated code contributors.
Conclusions:This milestone really made me reflect and appreciate what some of the early programming language pioneers went through, the first self hosted languages really are something special.
Let me know if you enjoyed this work and want it to continue.