Shecc: A self-hosting and educational C optimizing compiler
github.com
github.com
I'm not writing production software for a large audience, at best tools for myself which a few others might use.
Yet, it also seems a waste to be using what many now regard as out dated tech.
It would be a great thing if a C-2030 could be arranged with a new standard library and a move-semantics compiler mode (say).
If you try and learn what the ownership rules in the compiler are trying to teach you—admittedly less comprehensibly at times than you might prefer—about software design, it is an incredibly fun and rewarding language that will shape the way you write software in every other language.
Oh, and less undefined behaviors.
typedef struct { byte *data; u64 len; } array;
typedef struct { byte *data; u64 len; u64 cap; } vec;
typedef struct { byte *data; u64 len; } string;
etc.Then developers will adhere to those apis, so long as, one's own array-struct decays to the above, so there can be standard library fns against the above, eg.,
sort(array *a);
etc.Maybe it's legitimate to say "TCC must be a single-file amalgam first and you have to use an external preprocessor".
[1] https://gcc.gnu.org/onlinedocs/gcc/Incompatibilities.html
[2] Assuming that we don't count things like `#pragma` or `#include_next`, which can be added without affecting other preprocessing jobs.
[1] https://en.cppreference.com/w/c/language/translation_phases#...