I've been toying around with some development recently. I like to look at different languages, and I like to make a decision on the language based on what the project I might be building.
As such I was looking at 4 languages. C, C#, Go and Vala.
For this test I wanted to see the size of a simple "Hello, World!" program. This would just publish "Hello, World" out onto the console.
I was curious about the size of the binary file once compiled.
- C = 8.6Kb
- Vala = 9.43Kb
- Go = 1.9Mb
- C# = 35.6Mb
- ASM = 920Bytes**
*Edit - none of the above have been optimised with their compilers - so these are default compilation to binary - I am sure they can be squeezed a bit more.
**Edit - After discussion on the size of the C binary, I thought it would be interesting to see what ASM would be... and it's tiny. So a lot of the C stuff is due to the stdio.h and redundant for actually printing text to the console.
Now, this isn't really fair, as C# was never really intended to run as a single binary - it just so happens now you can. But I was staggered at the size difference.
Also, Go is pretty bloaty.
Vala makes sense, as it essentially transpiles to C++ before final compilation.
And C - is super tiny.
So - what does this all mean? Does size really matter? Well that entirely depends on what you're trying to do. Embedded services, or running on a low tech bit of kit, then optimisation and size will matter.
The ease of development also matter. C can be pretty mind mending, having to think about garbage collection, and the finer detail of relatively low level stuff.
Go is a relatively simple language, and can be pretty quick to develop in.
Vala is getting closer to C# as syntax goes and are both competent OOP languages.
I'm not going to say which is best, as there is no winner. I was just curious about the outcome.