2 ms·
The binary sizes that Nim produces are as usual misrepresented. D and C will blow it out of the water. Here's some D code: import core.stdc.stdio; ext
by kalekold 7y ago
The binary sizes that Nim produces are as usual misrepresented. D and C will blow it out of the water. Here's some D code:
import core.stdc.stdio;
extern(C) void main()
{
printf("Hello, World!\n");
}
Compile with:
$ dmd -betterC main.d
$ ls -h main
-rwxrwxr-x 1 user group 8.5K Sep 24 12:39 main
- szemet 7y agoI guess the examples use the default std libs, and runtimes of the languages. So in this sense your D example is the misrepresentation, by directly calling libc. If these kinds of low level size optimizations are enabled then both Nim and Rust can be more than 50 times smaller than your D example ;) : 150 byte Nim: https://hookrace.net/blog/nim-binary-size/ https://hookrace.net/blog/nim-binary-size/ 151 byte Rust: http://mainisusuallyafunction.blogspot.com/2015/01/151-byte-static-linux-binary-in-rust.html http://mainisusuallyafunction.blogspot.com/2015/01/151-byte-...