Glossary
Assembly language
An assembly language is a low-level programming language which is
processor-specific and has a direct correspondence between its
instructions and those available on said processor.
Automatic memory
Automatic memory is a form of memory which is stored on the stack.
This type of memory allocation is automatic and its lifetime is the
duration of the scope it is allocated in. Hence, there is no need to
explicitly release the allocated memory.
Command line interface
A command line interface (CLI) is a user interface where interaction
between the user and the computer is done textually. For example,
when you interact with your *shell* in a *terminal*, you are using a
CLI.
Compiler
A compiler is a program that translates code written in a *source
language* into an equivalent code in a *target language*. Generally,
compilers translate code from a high-level programming language into
a low-level language which will then be used to create an executable
file.
Dynamic memory
Dynamic memory is a form of memory which is stored on the heap. This
type of memory is usually allocated by calling functions from the
`malloc` family in the standard library. Its lifetime is that of the
program, until it is released by calling `free`. A program exiting
without releasing all of its dynamic memory is said to be *leaking*.
File descriptor
A file descriptor is an integer that uniquely identifies an open
file. When a process is started, 3 file descriptors are
automatically opened by the kernel: `stdin`, `stdout` and `stderr`.
Graphical user interface
A graphical user interface (GUI) is a user interface that includes
graphical elements such as windows, icons, buttons\... GUIs can be
seen as the counterpart of command line interfaces and are generally
manipulated using a keyboard and mouse.
Hardware
Hardware is the name given to all the physical parts of a computer.
High-level
As opposed to low-level, it is a technical term describing
components with a high level of abstraction from a computer\'s inner
workings. We often describe programming languages with this term,
for example *Java* and *Python* are considered high-level languages.
Heap
The heap is the portion of memory dedicated to dynamic allocation.
Unlike the stack, the heap can be fragmented into many blocks of
various sizes. Allocating on the heap is slower than on the stack
because you do not know the size in advance and needs to find an
empty spot. Data allocated on the heap must be freed manually
because its lifetime linked to the one of the current process.
Kernel
A kernel is the core of an operating system, with a complete control
over the system. Linux is an example of a free and open-source
kernel, whereas GNU/Linux is considered to be the whole operating
system containing the Linux kernel as well as various tools from the
GNU system.
Linker
A linker is a program which takes several object files to combine
them into a single binary file. The output can be either an
executable, a library, or even another object file. Linkers are
often used at the end of the compilation toolchain, to combine files
generated by the assembler.
Low-level
As opposed to high-level, it is a technical term describing
components with little or no abstraction from a computer\'s inner
workings. For example, *C* and *C++* are considered low-level
programming languages.
Multitasking
Multitasking is the execution of multiple tasks in a *concurrent*
manner. This does not necessarily mean that tasks are computed in
*parallel*, but rather that many tasks can be interrupted and split
into parts to share the computer resources over a period of time.
OS
An operating system (OS) is a software program which manages both
hardware and software resources to allow user interaction. Some
examples of common operating systems are: Windows, macOS and
GNU/Linux.
Process
A process is the set of resources used to execute a program (its
code, memory, open files, \...). Inside the process, the execution
is actually performed by one or multiple *threads*.
Shell
A shell is a computer program serving as an interface with the
operating system. The English word *shell* was chosen because it
acts as a shell around the kernel. Generally, users interact with a
shell either using a command-line interface (CLI) or a graphical
user interface (GUI).
Stack
The stack is a portion of memory dedicated to automatic memory
allocation. It is mostly used to store local variables and function
parameters. Unlike the heap, allocation on the stack is very fast
because there is no fragmentation (the next empty spot is always the
top of the stack), and the size is known in advance. Variables
allocated on the stack are automatically freed when they go out of
scope.
Static memory
Static memory is allocated when the program starts. Its size is
fixed when the program is created and its lifetime is that of the
entire program. It is generally used for global variables and
variables created with the `static` keyword. These variables are
only initialized the first time their scope is entered and hence
preserve their previous value when a scope is entered again.
Stderr
The standard error (stderr) file descriptor is an output file
descriptor automatically opened by the kernel on process creation
which is written to to inform the user about errors and warnings.
This file descriptor\'s number will be 2.
Stdin
The standard input (stdin) file descriptor is automatically opened
by the kernel on process creation and represents *input*. The input
for the process is read from it. For example, if you pipe the output
of a process A into a process B, you are directing the standard
output of process A into the standard input of process B. This file
descriptor\'s number will be 0.
Stdout
The standard output (stdout) file descriptor is an output file
descriptor automatically opened by the kernel on process creation
which is written to for normal output messages. This file
descriptor\'s number will be 1.
Stream
A stream is a sequence of data made available to a program over time
for it to be processed.
Syscall
A system call (syscall) is the way in which a program requests a
service from the kernel. For example, a regular program can\'t
interact directly with a disk so it must use the syscall API exposed
by the kernel to manipulate files on a disk (`open`, `read`,
`write`, `close`). The `man` section containing information about
system calls is the second one.
Terminal
A terminal is the interface allowing access to the command line. A
terminal can be seen as the \"container\" program which encapsulates
our shell and allows us to interact with it.