4 ms·
$ cat hello.c int main() { printf("Hello, world!\n"); } $ gcc hello.c $ ls -l a.out -rwxr-xr-x 1 brian staff 8.5K Oct 11 02:23 a.out* And that's
by kelnos 15y ago
$ cat hello.c
int main() { printf("Hello, world!\n"); }
$ gcc hello.c
$ ls -l a.out
-rwxr-xr-x 1 brian staff 8.5K Oct 11 02:23 a.out*
And that's compiled code! And it also links to libc! But then again, any JS program requires tons of compiled C/C++ code to run.
- morsch 15y agoSee here for an effort to create the smallest possible hello world x86 ELF binary: http://timelessname.com/elfbin/ http://timelessname.com/elfbin/ His original C app was about 6k, and 3k when stripped of debug symbols. Not content, he switched to assembly, which got him down to ... nah, I won't spoil the rest. ;)
- dramaticus3 15y agoThat's dynamically loaded, try it with the runtime $ gcc hello.c $ ls -l a.out -rwxr-xr-x 1 maht maht 4511 Oct 11 16:38 a.out $ gcc --static hello.c $ ls -l a.out -rwxr-xr-x 1 maht maht 574106 Oct 11 16:38 a.out