Nikolay Blokhin Facebook Nikolay Blokhin Instagram Nikolay Blokhin Linkedin Nikolay Blokhin Twitter

Hi, I'm Nikolay Blokhin I build the cool things with Python and Swift

Vala vs Assembler

Vala 'Hello word':

class Demo.HelloWorld : GLib.Object {
    public static int main(string[] args) {
        stdout.printf("Hello, world!");
        return 0;
    }
}

Asm 'Hello word':

section .text
     global _start
_start: 
     mov edx,len
     mov ecx,msg
     mov ebx,1
     mov eax,4
     int 0x80
     mov eax,1
     int 0x80
section .data
msg db 'Hello, world!',0xa
len equ $ - msg

Result: Compiled program in assembly language has a size 360 bytes, in vala - 7832 bytes.