Demo: Hello, World at Five Heights¶
The same fourteen bytes, printed by programs written at five different levels of the stack.
Run¶
./hello-nolibc 2 system calls
./hello-asm 30 system calls
./hello-c 35 system calls
./hello-cpp 65 system calls
python3 hello.py 6155 system calls
Then read two traces in full:
And, one layer higher again:
Ask¶
- The whole trace of
hello-nolibcis three lines. What are the other thirty-three calls inhello-cdoing? - All five end in the same
write(). So what exactly is the extra cost buying? - Why does nobody write the two-system-call version?