Introduction
A compiled language, also interpretable, built around a single concept.
Archon is a compiled programming language — it produces a native executable — that is
also interpretable: the same compiler, archonc, can run a program on the spot without
going through the executable. That interpreted mode is what this site uses to run the
examples.
Its type system is built around a single concept, the archetype. The name of the
language comes from the Greek ΑΡΧΩΝ — ἄρχων, árkhōn, “the one who rules”: the chief
magistrate of the Greek cities, and the root of “monarchy”, “hierarchy”, “anarchy”. The same
word gives the archetype, the language’s central concept, and the source file extension,
.arc: ΑΡΧ transliterates to arc. One Greek word under the name, the concept and the
extension.
One trait that says a lot about the project: the compiler is written in Archon. It compiles itself. There has been no compiler written in another language since version 0.0.6.
How to read this course
The course moves through numbered sections. Whenever a notion is illustrated with code, the complete program is in the page, with a Run button: it goes to the server, runs in an isolated sandbox, and its output comes back below the code. You can edit the program before running it — that is the whole point. The sandbox is sealed and limited (a few seconds, a little memory, no network), so do not be surprised if an endless computation gets cut short.
This first subsection contains no code. The next one does.