logoalt Hacker News

gaigalaslast Wednesday at 8:41 AM3 repliesview on HN

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


Replies

angry_octettoday at 2:07 AM

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

t-3today at 5:08 AM

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.

show 2 replies
jonahxtoday at 5:07 AM

gorgeous!