Comment by badmonster

2 days ago

Could you elaborate on how this compiler interacts with the operating system? Specifically, how does it handle features like structs, and what are the current limitations or planned enhancements in this area?

There is no magic interaction between the compiler and OS. It simples compiles to the same machine code (i386) and uses interrupts for system calls. Structs are handled as a memory region with a size based on its members, and the member access is simply an offset into that region.

Current it has lots of limitations such as only int and char, no switch statements etc. The biggest change from default C, is allowing functions in structs and implicit passing a struct to a function if it’s a struct function. You can read more here:

https://github.com/joexbayer/C-Compiler