3 ms·
For some value of “C”: > Notably, it doesn't support: > structs :-( would be possible with more code, the fundamentals were there, I just couldn't squeeze it
by teddyh 3y ago
For some value of “C”:
> Notably, it doesn't support:
> structs :-( would be possible with more code, the fundamentals were there, I just couldn't squeeze it in
> enums / unions
> preprocessor directives (this would probably be 500 lines by itself...)
> floating point. would also be possible, the wasm_type stuff is in, again just couldn't squeeze it in
> 8 byte types (long/long long or double)
> some other small things like pre/post cremements, in-place initialization, etc., which just didn't quite fit any sort of standard library or i/o that isn't returning an integer from main()
> casting expressions
- deleted 3y ago[deleted]
- spease 3y agoC--23 (Respect to the author for doing this, I just couldn’t resist the obvious joke)
- vgel 3y agoI actually almost made it a C-- (https://www.cs.tufts.edu/~nr/c--/download/ppdp.pdf https://www.cs.tufts.edu/~nr/c--/download/ppdp.pdf) compiler, but IIRC the `goto`s made me go with the regular C subset instead.
- vgel 3y agoWell, I set the 500 line budget up front, and that was really as much as I could fit with reasonable formatting. I'll be excited to see your 500 line C compiler supporting all those features once it's done ;-)
- pjmlp 3y agoBasically like many C compilers outside UNIX during the 1980's. RatC did not need 500 lines for its preprocessor support, by the way.