Hacker News new | past | comments | ask | show | jobs | submit login

  $ 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.



See here for an effort to create the smallest possible hello world x86 ELF binary: 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. ;)


That'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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: