Skip to content

Instantly share code, notes, and snippets.

@dmitryrck
Last active June 26, 2018 02:59
Show Gist options
  • Select an option

  • Save dmitryrck/ec5f9b7fb95b6908d19d37e5e1391827 to your computer and use it in GitHub Desktop.

Select an option

Save dmitryrck/ec5f9b7fb95b6908d19d37e5e1391827 to your computer and use it in GitHub Desktop.
Size of binaries (HelloWorld)
bin*
hello-world.hi
hello-world.o

This is just for curious, it does not measure anything ☺️.

Size of binaries

Date: Mon Jun 25 10:24:55 NZST 2018

$ du -sh bin*
5.3M	bin-hello-world-rust
2.8M	bin-hello-world-haskell
2.0M	bin-hello-world-golang
872K	bin-hello-world-crystal
800K	bin-hello-world-haskell-stack
300K	bin-hello-world-crystal-release
16K	bin-hello-world-haskell-dynamic
12K	bin-hello-world-c

Note:

  • Size of hello-world for haskell using a stack project decrease to 800k. It is not included an example because gist does not allow subdirectories.
#include<stdio.h>
int main(void) {
printf("Hello World!\n");
return 0;
}
puts "Hello world!"
package main
import "fmt"
func main() {
fmt.Println("Hello world!")
}
module Main
where
main=putStrLn "Hello, World!"
fn main() {
println!("Hello world!");
}
default:
crystal build -o bin-hello-world-crystal hello-world.cr
crystal build --release -o bin-hello-world-crystal-release hello-world.cr
go build -o bin-hello-world-golang hello-world.go
rustc -o bin-hello-world-rust hello-world.rs
gcc -o bin-hello-world-c hello-world.c
stack ghc -- hello-world.hs -o bin-hello-world-haskell
stack ghc -- -dynamic hello-world.hs -o bin-hello-world-haskell-dynamic
clean:
rm -fr bin*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment