José Daniel Fernández Santos has released a book that challenges the modern assumption that artificial intelligence requires supercomputers to be understood. By forcing learners to program AI foundations on an 8-bit Z80 processor—the heart of classic machines like the ZX Spectrum—the project aims to turn 'black box' concepts into tangible, byte-by-byte instructions.

From Symbolic Logic to Data Models

The educational journey begins with symbolic AI, where knowledge is separated from reasoning mechanisms. This includes building expert systems for diagnostics and a conversational simulator based on ELIZA to explore pattern-based dialogue.

A ZX Spectrum screen displaying a BASIC expert system diagnosing a tape-loading problem.
An example of a BASIC-based expert system used to diagnose hardware issues on the ZX Spectrum.www.dfsantos.com

This image illustrates the symbolic AI approach where expert systems are built to perform specific diagnostic tasks.

Book Specifications: Chapters 12 chapters; Pages 325 pages
Book Specificationsamazon.es

Chart drawn by HN Digest from figures reported by amazon.es; values are shown as written in the source.

The focus then shifts from rules to data. Readers implement linear regression using real CO2 measurements and supervised classification models like k-NN (k-Nearest Neighbors) and Naive Bayes to categorize data points.

A ZX Spectrum display showing a regression line fitted to real CO2 measurement data.
A linear regression model plotted on the ZX Spectrum using real-world CO2 data.www.dfsantos.com

The book demonstrates the shift from rules to data by implementing linear regression on 8-bit hardware.

By moving through these different paradigms, the book illustrates how AI evolved from hard-coded logic to probabilistic and proximity-based decision-making.

“Understand artificial intelligence by programming it from scratch in BASIC.”

— Artificial Intelligence for the Z80 | dfsantos.com

Neural Networks on 8-Bit Hardware

A significant portion of the work is dedicated to the mechanics of neural networks. Readers build a perceptron—an artificial neuron that combines inputs and weights—to distinguish between horizontal and vertical lines.

The curriculum progresses to multilayer networks, introducing hidden layers and the sigmoid function. These concepts are applied to a digit-recognition project, where the book explains the mechanics of backpropagation and error correction.

A technical diagram showing the structure of a neural network with inputs, hidden layers, and outputs.
A diagram illustrating the architecture of a neural network, including hidden layers and activation functions.www.dfsantos.com

This diagram explains the mechanics of multilayer networks and the flow of information through hidden layers.

Because the Z80 has limited memory and speed, these implementations serve as a practical laboratory for understanding how weights are adjusted and how generalization occurs in a constrained environment.

Algorithmic Efficiency and Constraints

A core theme of the book is the 'Battle Against Complexity.' It uses the Z80's limitations to make algorithmic complexity visible, comparing the execution times of Bubble sort, Shell sort, and Quicksort.

A performance chart on a ZX Spectrum comparing the execution times of three different sorting algorithms.
A comparison of Bubble sort, Shell sort, and Quicksort execution times on the Z80 processor.www.dfsantos.com

The book uses these comparisons to demonstrate how algorithmic efficiency outweighs raw hardware speed.

These comparisons are intended to show that increasing clock speed is not a substitute for choosing an efficient algorithm. This prepares the reader to optimize the AI models they build later in the book.

The final project, Conway's Game of Life, serves as a study of emergent complexity. It demonstrates how simple local rules can produce complex behavior without the need for explicit training or massive datasets.

Practical Limitations and Scope

While the book provides a deep dive into AI fundamentals, it is intentionally limited by the 8-bit architecture. The source material does not provide specific performance benchmarks or execution times for the neural networks, only noting that they are measured and plotted within the text.

The focus remains on the 'science of computation' rather than high-performance production. The goal is to provide a guide for rediscovering the thrill of building AI from scratch, where every byte counts and every decision matters.

What Hacker News readers are saying

  • Alternative: One commenter suggested that the title might be misleading, arguing that the project's focus on BASIC would make it applicable to any similar dialect rather than being specific to the Z80 processor. comment ↗
  • Experience: Another reader shared their experience performing similar exercises on a TI-83 calculator years ago, noting that they viewed these programs as natural conclusions of math and computer science coursework rather than 'artificial intelligence.' comment ↗
  • Skeptical: One commenter expressed skepticism regarding the marketing copy, suggesting that the description on Amazon appeared to be AI-generated. comment ↗

Summarized opinions from the Hacker News thread, not verified facts. Read the full discussion ↗