What is code?

Planned chapter | Dan Hollick

What is code?

Code is structured text whose meaning is defined by a language and realised by software that parses, checks and executes it.

What is code? chapter cover
IN PROGRESS

The source chapter is still planned. This route preserves the collection and offers an original conceptual preview.

Code is structured text whose meaning is defined by a language and realised by software that parses, checks and executes it. The apparent simplicity comes from a set of carefully chosen representations, transformations and physical assumptions working together.

source textsyntax treesemanticsbehaviour

Syntax

A grammar decides which arrangements of tokens form valid programs.

This is one part of a longer chain: source text becomes syntax tree becomes semantics becomes behaviour. The useful abstraction hides the physical work, but the underlying constraints still shape the software built above it.

Semantics

Language rules define what each valid structure means.

The implementation is full of compromises. Precision, speed, storage and energy rarely improve together, so practical systems choose the errors people are least likely to notice.

Runtime

Values, memory, input and side effects connect the abstract program to a real machine.

Once this layer is visible, familiar design conventions stop looking arbitrary. They are accumulated responses to the capabilities and limits of the machinery below.

╌╌ END ╌╌
Next chapterCompilers and interpreters.

A visual study based on the original chapter. Text is condensed and rewritten.