
Hello World Executable Sizes in 18 Languages - mqt
http://mbishop.esoteriq.org/hellosize.html
======
Zak
In some of these cases, I suspect the main difference is related to how the
language's runtime libraries are linked to the executable. Chicken, for
example produces a 15k executable. Running that executable requires the
presence of a much larger dynamically linked libchicken.

As mentioned in the article, an executable SBCL core includes all of SBCL.
Considering that Java and .NET produce "executables" that are actually
executed by their respective runtimes, I think it might be more fair to SBCL
to compare the size of a FASL. It's 828 bytes for a FASL compiled from

    
    
        (print "Hello, world!")
        (sb-ext:quit)

------
jwr
This is a very silly comparison. What is an executable? Do you consider
dynamic libraries that it uses a part of it? Do you consider the language
runtime a part of it?

As an example, 12K for java is a ridiculous number. What's the size of the
runtime required to run it? I bet it is larger than the 25MB for Common Lisp,
but it doesn't get counted -- why?

And if you're there, you need to define what your base runtime is -- is it the
OS kernel? OS kernel + a set of base dynamic libraries? If so, which ones? Is
glibc standard? glib? zlib?

------
gertburger
It seem like the author does not differentiate between compiled (To machine
code) and (To intermediate/byte code). Does that mean the pyc(114 bytes on my
machine) generated by python for 'print "Hello world"' can be compared to the
others?

It is still interesting though.

~~~
aniketh
don't forget you would have to add a shebang line to make it truly executable

~~~
smcdow
Not really:

$ echo 'echo $0' > 'Hello, world!' $ chmod +x 'Hello, world!' $ 'Hello,
world!' Hello, world! $ wc 'Hello, World!' 1 2 8 Hello, world!

8 bytes. I think that's probably as small as you can get.

~~~
smcdow
Oh, brother, formatting.<p> <pre> $ echo 'echo $0' > 'Hello, world!' $ chmod
+x 'Hello, world!' $ 'Hello, world!' Hello, world! $ wc 'Hello, World!' 1 2 8
Hello, world! </pre>

------
jws
It would be interesting to also see how much RAM was used to run Hello World,
but then I'd want to also know how much was shared with other programs, shared
between instances of this program, and not shared... it would probably get out
of hand.

------
huhtenberg
The size of D executable - 230K - is a quite big surprise.

------
statictype
> Common Lisp - 25MB

Double-You Tee Eff.

What, does Common Lisp not have an incremental linker or something? Even
Delphi executables are never that big.

>Lisp has the largest executable file (because to create an executable, you
have to dump a "core image") at 25MB

Can someone explain what this means? I'm clueless.

~~~
mqt
lispm, from reddit:

    
    
        There are different strategies to create CL applications.  
        
        - save an executable image. This will mostly dump the Lisp system and
        when you start it up, you have mostly everything back. The size
        of the dumped image depends on the size of your Lisp system. SBCL
        is already large and does not have any special features to make
        it smaller. CLISP for example writes much smaller images than
        SBCL. Clozure CL is also smaller. Here also is important with how
        much debug information the original Lisp image was created. The
        saved image typically will include all that. Corman CL on Windows
        compresses the Lisp data to save space. 
        
        - deliver an application. That's for example what LispWorks and
        Allegro CL can do. They allow functionality and
        information (debug info, documentation strings, arglists, source
        locations, symbols, caches, ...) to be removed (for example by
        treeshaking, or by removing whole functionality groups). The size
        of the generated application will depend on what you leave out
        and which delivery level you are choosing. Stuff that might not
        be needed: compiler, debugger, disassembler, editor, inspector,
        REPL, ...
        
        - deliver a static application. I don't know which currently
        maintained CL implementation does that. There were several Common
        Lisp implementations that generate 'small' and static C code from
        Lisp. CLICC, Ibuki's CONS, WCL, Lisp-to-C, ThinLisp were in that
        league. They were used for application delivery, where the
        application might be really small and does not have any large
        runtime or development environment.
        
        There are also some other options. Probably ABCL could generate a
        JAR file that could be started with an installed JVM. Often Lisp
        compilers can compile code to native code compiled files (fasls)
        and even can append several fasls into one. Then one does need
        only to ship the fasl file, given that the user has the a Lisp
        installed that can load the fasl.
    

[http://www.reddit.com/r/programming/comments/7swzs/hello_wor...](http://www.reddit.com/r/programming/comments/7swzs/hello_world_executable_sizes_in_17_languages/c07bd5z)

------
TrevorJ
I'd like to see the code for "Hello World" for biological systems.

------
smcdow
It can be done in 8 bytes.

