dom96 / binary_size

21 stars 5 forks source link

Add V-lang binary #10

Open gslicer opened 5 years ago

gslicer commented 5 years ago

--> vlang.io (V on GitHub)

cat print('Hello World!') >> hello.v v --prod hello.v mv a.out hello_v

gslicer commented 4 years ago

Aleternatively:

fn syscall5(number int, arg1 int, arg2 string, arg3 u64, arg4 u64, arg5 voidptr) int

fn write(fd int, data string, nbytes u64) int {
    return syscall5(1, fd, data, nbytes, 0, 0)
}

fn main() {
    write(1, "Hello World!",12)

compile using -bare option, resulting binary shall by statically linked and less than 2KiB in size