IRC channel logs
2025-03-04.log
back to list of logs
<fossy>um, i'll come back in 10 minutes when the netsplits have calmed down <fossy>cosinusoidally: more than anything, that was a PoC to myself as to the current (circa: 2 years ago) state of an alternative bootstrap. this is what i ran into; <fossy>1. at the time, it was quite difficult to implement a "proper" (recursive descent) compiler while working with the limited feature set of M2-Planet and a number of bugs/caveats <fossy>i think this would be less of an issue now; particularly, forward declaration of structus, enums, variables in loop bodies, and long int <fossy>those would make a huge difference. <fossy>2. i got to the point where the next step would be adding a preprocessor, and i was in a number of minds on how to do that. <fossy>3. i was unhappy with the architecture of chibicc's codegen. it is *entirely* non-portable, basically only allows you to target one arch. <fossy>further it relies on a lot of gas-isms that are not available in the much more bare bones M1 <fossy>I think to fix both of those last two points about portability and gas-isms, some kind of simple IR (3AC, probably) would be very helpful/necessary <fossy>chibicc's parser is very sound though, just not the codegen for our purposes <oriansj>fossy: well that is the problem of defining a C subset. Unless you know exactly what features are needed by what. It becomes easy to skip features that are essential to one program that you need even thought they would have been trivial to add. <oriansj>for example when the correct way to support FILE* was figured out. I could have just added a dozen lines to cc_* and all of the resulting binaries would have been 10x faster.