Remix.run Logo
gaigalas 2 days ago

Single standalone file, no external tools used, PATH='' (empty), portable (bash, dash, ksh, zsh), produces x86 ELF executables, has mini-libc builtin.

Usage:

printf 'int main(){puts("hello");return 0;}' | sh c89cc.sh > hello

chmod +x hello

./hello

t-3 16 minutes ago | parent | next [-]

Why not POSIX or some common external tools where it makes sense? Most of those big switch statements could be easily replaced with some standard programs that already exist everywhere.

angry_octet 3 hours ago | parent | prev | next [-]

I can't think of a reason to use c89cc.sh, but I salute this effort nonetheless.

jonahx 17 minutes ago | parent | prev [-]

gorgeous!