C89cc.sh – standalone C89/ELF64 compiler in pure portable shell
gist.github.com - 129 poäng - 33 kommentarer - 178082 sekunder sedan
Kommentarer (10)
- kelsey98765431 - 29776 sekunder sedanWould be a lot better if it came with tests. Please do this justice and dont let it rot as a gist, make a real repo and add some docs and at least smoke tests or some kind. Thanks
- gaigalas - 178082 sekunder sedanSingle 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
- uecker - 8465 sekunder sedanI am tempted to click the "report abuse" link ;-)
- JackSmith_YC - 15526 sekunder sedanPure shell. Love the minimalism here... especially when every tiny CLI tool these days seems to require a 50MB node_modules folder just to run. There’s a certain Zen in doing things with zero dependencies. Reminds me of why I got into Unix in the first place.
- wengo314 - 3987 sekunder sedanif one could boostrap tcc with it, then it might be a viable tool.
- _ache_ - 24398 sekunder sedanI'm tempted to execute it, but it may as well be shellcode I couldn't tell.
- jey - 27873 sekunder sedanIt targets x86-64/ELF? I thought it would target `sh` to be portable?
- dmead - 5648 sekunder sedanThis is vibe coded right?
- dmitrygr - 29814 sekunder sedanMany parts of this are clearly autogenerated, but that in no way diminishes the sickening impressiveness of it!
- self_awareness - 11248 sekunder sedan"Claude please generate me a C compiler in bash"
I mean, today it's possible to generate it in Tcl, Elisp, Windows BAT, Powershell.
The effort is just 1 prompt.
The WHY question is much more important today -- "because I can" no longer makes sense, because we all can do much, much more with minimum effort today than before LLMs.
Nördnytt! 🤓