SectorC: A C Compiler in 512 bytes
xorvoid.com
SectorC: A C Compiler in 512 bytes
1–10 of 82 posts
Re: SectorC: A C Compiler in 512 bytes
#2Re: SectorC: A C Compiler in 512 bytes
#3Re: SectorC: A C Compiler in 512 bytes
#4I'm wondering if you can build an actual "Linux from scratch" with this as the lowest level, without the need to use a host system at all.
Re: SectorC: A C Compiler in 512 bytes
#5or alternatively for embedding a C compiler inside a LLM to use the LLM as a form of virtual machine.
Re: SectorC: A C Compiler in 512 bytes
#6I'm wondering if you can build an actual "Linux from scratch" with this as the lowest level, without the need to use a host system at all.
Without structs? Good luck...
Perhaps with a few more "layers of compilers" on top you can get a very early GCC going.
Re: SectorC: A C Compiler in 512 bytes
#7Re: SectorC: A C Compiler in 512 bytes
#8I'll point out to any passerby that this C doesn't support structs, so it's unlikely you'd actually want to build anything in it.
Re: SectorC: A C Compiler in 512 bytes
#9something like this could be interesting for deep-space applications where you only have a bare metal environment with hardened processor and limited memory & of course ping time of days (to earth). or alternatively for embedding a C compiler inside a LLM to use the LLM as a form of virtual machine.
Re: SectorC: A C Compiler in 512 bytes
#10Earlier quoted context omitted.
Without structs? Good luck...
wonder how many extra bytes for structs?
The problem is not just declaring structs but accessing them, referencing them, accessing/referencing fields and subfields, etc. That has to all be in the syntax. For such a minimal project you can ignore initialization.
I did all this while adding maybe 500 lines of C to GitHub.com/vitiral/fngi. Never tried for this level of minimalism though.