Menu

Overview

Relevant source files

Purpose and Scope

This document provides an introduction to the X1 Algol compiler and simulator repository, a modern revival of Edsger Dijkstra's historic 1960 Algol 60 compiler for the Electrologica X1 computer. The system consists of a complete Algol 60 compiler, X1 machine simulator, comprehensive test suite, and collection of example programs that demonstrate the full capabilities of this historic computing environment.

For detailed build instructions and running your first programs, see Getting Started. For in-depth technical documentation of specific components, see Core Components. For Algol 60 language features and syntax, see Algol 60 Language Support.

Historical Context

The original Algol 60 compiler was developed by Edsger Dijkstra in 1960 for the Electrologica X1, one of the first transistorized computers. This implementation represents a faithful recreation of that historic system, preserving both the compiler logic and the X1 machine architecture while enabling modern developers to experience and study this foundational piece of computing history.

The project sources were recovered from https://gtoal.com/languages/algol60/x1algol/ and have been carefully reconstructed to maintain compatibility with the original system's behavior and capabilities.

Sources: README.md3-6

System Architecture

The system implements a complete compilation and execution pipeline, from Algol 60 source code through X1 object code to program execution on a simulated X1 machine.

Core System Components

Sources: README.md7-15 .gitignore1-14

Compilation and Execution Flow

Sources: README.md17-46 examples/README.md25-47

Major Components

ComponentPrimary Class/ModuleResponsibilityKey Features
Compilerx1algcAlgol 60 → X1 object codeLexical analysis, syntax parsing, code generation
MachineMachineX1 hardware emulationMemory management, I/O operations, program loading
ProcessorProcessorCPU instruction executionInstruction cycle, register management, opcode dispatch
StackVirtualStackRuntime stack managementType-safe operations, procedure frames, expression evaluation
ArchitectureX1ArchitectureData format handlingX1 ↔ IEEE conversion, encoding/decoding
Testingx1_machine fixtureQuality assuranceUnit tests, integration tests, example validation

Sources: README.md9-15

Key File Organization

Sources: README.md7-15 Makefile1-35

System Capabilities

The X1 Algol system supports the complete Algol 60 language specification, including:

  • Procedures and Functions: Full recursion, call-by-value and call-by-name parameter passing
  • Control Structures: For loops, while loops, conditional statements, switch constructs
  • Data Types: Integers, reals, arrays (multi-dimensional with dynamic bounds), booleans
  • I/O Operations: Text output, formatted printing, character encoding conversion
  • Mathematical Functions: Elementary functions (sin, cos, sqrt, etc.)
  • Advanced Features: Jensen's device, nested block structure, label parameters

The simulator provides a faithful emulation of the X1 architecture with:

  • Complete instruction set implementation (100+ opcodes)
  • Type-safe stack-based execution model
  • Memory-mapped I/O system
  • IEEE ↔ X1 floating-point conversion
  • Comprehensive debugging and tracing capabilities

Sources: examples/README.md1-24 README.md47-61

Getting Started

To build and run the system:

Run your first Algol 60 program:

For complete build instructions and usage examples, see Getting Started. For exploring the extensive collection of historical Algol 60 programs, see Example Programs.

Sources: README.md17-61 Makefile15-34

OSZAR »