Skip to content
BIASED

High-level languages and the operating system

Block 1 of 3~3 min

The runtime’s role

A C program is almost directly against the kernel: malloc becomes mmap/brk, pthread_create becomes clone, printf ends in write. Python, Java and JavaScript promise automatic memory, portability and rich libraries — those promises are a runtime: a substantial C (or C++) program that implements the language with the same system calls the C half of the course used.

The runtime’s job is not magic. It asks the kernel for anonymous pages with mmap, creates threads, multiplexes I/O with poll/epoll or a library event loop, installs handlers with sigaction, and starts subprocesses with fork/exec or posix_spawn. Everything above — objects, GC, green threads, async — is user-space policy on that substrate. Understanding a language at systems level means seeing which syscalls it wraps and where it pays.

Answers are saved on the server and tied to this browser until you sign in.