# Project:M36: a relational algebra engine in Haskell that takes no prisoners

> Project:M36 implements the relational algebra as described by Chris Date, in Haskell, with two frontends: TutorialD for the pure algebra and SQLegacy for people who think in SQL. It is opinionated software by design, and it is released into the public domain.

**agentm/project-m36** — Project: M36 Relational Algebra Engine

- Repository: https://github.com/agentm/project-m36
- Stars: 955 · Forks: 50
- Language: Haskell
- License: Unlicense
- Published: 2026-10-20 · Updated: 2026-10-20 · Language: en
- Canonical page: https://hysenlabs.com/projects/agentm-project-m36

## An engine that deliberately refuses to be convenient

Project:M36 implements a relational algebra engine as inspired by the writings of Chris Date, and it supports both SQL and TutorialD interactive access.

The README states the philosophy without hedging. Unlike most database management systems, Project:M36 is opinionated software which adheres strictly to the mathematics of the relational algebra. The stated purpose of that adherence is to prove that software which implements mathematically sound design principles reaps benefits in the form of code clarity, consistency, performance, and future-proofing.

The epigraph at the top of the README is the same argument compressed into one line: software can always be made faster, but rarely can it be made more correct. That is the design brief. A relational algebra engine has a specification, and the specification is mathematics rather than a product manager's requirements document, so there is nothing to negotiate. The cost of that rigidity is equally clear: an engine that follows the mathematics will not implement SQL as its creators wrote it, and the project keeps a separate front end for SQL rather than pretending the two are the same.

The implementation is Haskell throughout, and the licence is the Unlicense, which the README badge describes as Public Domain. There is no attribution requirement and no copyleft obligation, which makes it one of the few database engines you can read, borrow from and ship inside a commercial product without a licence conversation.

## Docker is the shortest path to a running engine

The quick install is a container run, and the README notes that this works on Windows 10 and later, macOS and Linux.

For the TutorialD command line interface:

```bash
docker run -it projectm36/project-m36 tutd
```

For the SQL dialect command line interface:

```bash
docker run -it projectm36/project-m36 sqlegacy
```

The difference between those two words is the whole design of the project in miniature. `tutd` gives you TutorialD, the language that expresses the relational algebra directly. `sqlegacy` gives you SQLegacy, a SQL dialect that the README presents as a way to learn how SQL differs from the relational algebra.

Running from source is the other route, and the development notes say the project is developed in Haskell and compiled with GHC 9.2 or later. The repository carries a project-m36.cabal file and a cabal.project, plus stack configuration files for GHC 9.4 and GHC 9.6, a Nix shell and a default.nix, a release.nix and a docker.nix, so the build is reproducible through more than one toolchain. There is also a Developer Setup document and a Changelog for anyone who wants to work on the engine itself rather than run the published image.

The practical advice is to start with the container. The engine is a Haskell program with a nontrivial build, and the tutorial documents assume you have something running to type into.

## TutorialD and SQLegacy target different audiences

The use cases section lists four, and the first two explain why two frontends exist.

The first is to learn about the relational algebra via TutorialD. The second is to use SQLegacy to learn how SQL differs from the relational algebra. These are not the same goal, and confusing them is the most common misunderstanding about this project. TutorialD is the native language of the engine, and using it is how you see the algebra directly. SQLegacy is the teaching device: it lets someone who already writes SQL meet the algebra by seeing where the two diverge.

The other two use cases are practical. Storing and manipulating databases is one. Using Project:M36 as a native Haskell database backend is the other, and that second one is the strongest practical argument for the project, because a Haskell application gets a relational store with no runtime dependency on an external server and no impedance mismatch between the domain types and the storage engine.

The documentation list supports that reading. There is a 15 Minute Tutorial, a TutorialD cheatsheet, a TutorialD tutorial, a TutorialD walkthrough as a Jupyter Notebook, and an introduction to the relational algebra for people starting from nothing.

## In process library or remote server

The README states that Project:M36 can be used as an in-process or remote DBMS, and the documentation list shows two different client stories.

The in-process path is the Simple Client API, described as a client library for the engine, plus the ProjectM36.Client Library document and examples such as SimpleClient.hs in the examples folder. That is the model where the database lives inside your program and you talk to it through a Haskell interface, with no protocol in between.

The remote path runs the engine as a server. There is a Server Mode document for serving remote Project:M36 databases, a WebSocket Server document, a Jupyter Notebook Kernel document, and a Notifications document for using notifications, plus a Persistent Driver integration maintained in a separate repository by YuMingLiao. Client code examples sit alongside server side examples: examples/blog.hs and examples/hair.hs sit next to examples/SimpleClient.hs.

The engine itself has more machinery than a toy implementation. The advanced features list covers Role-Based Access Control, Authentication, Transaction Graph Operators, Merkle Transaction Hashes, Merge Transactions, Isomorphic Schemas, Replication, Data Frames for Sorting, Handling DDL Changes, Adding New Data Types, Database-Manipulating Functions, Atom Functions and Trans-Graph Relational Expressions. The examples folder makes the same point in code, with Hospital.hs, Plantfarm.hs, Zoo.hs and a custom data type example that derives instances for tuples.

## The documentation argues about databases as much as it explains them

One of the more unusual things about this project is how much of its documentation is comparative and argumentative rather than instructional.

The Database Comparisons section carries an ACID Database Properties assessment, a document on NULL in SQL, a piece on reaching out of the tarpit with Project:M36, and an Architecture for Data Independence. Then there is a Why SQLegacy? document alongside the SQLegacy documentation itself.

This tells you what the project thinks it is for. It is not competing with production databases on features. It is making a case about data independence and about which database properties are worth having, and it uses its own implementation as the exhibit. The suggested reading list reinforces the framing: The Third Manifesto as the philosophical basis for relational algebra engines, Out of the Tarpit as the proposed architecture that minimises state and complexity, which the README says Project:M36 implements the requirements of, and Database Explorations for the practical arguments.

For an engineer, the value is different from a typical database's documentation. A guide that shows you a working engine and then explains why it is built this way teaches the theory by example. A guide that lists configuration options teaches the product. Whether you want the first kind is a matter of taste, but it explains why the project ships a 15 minute tutorial next to an ACID assessment.

## Other relational algebra engines and how they differ

The README lists related projects, and the differences are about implementation strategy rather than about mathematics.

Rel is a TutorialD implementation against a BerkeleyDB backend. Andl is a new database language with SQLite and PostgreSQL backends. Coddie is a Python based relational algebra interpreter. The Third Manifesto is listed as the philosophical basis for relational algebra engines rather than as a software project.

Read together, those lines describe three different answers to the question of what to build a relational algebra engine on top of. One uses an existing key value store, one targets relational backends that already exist, and one implements the algebra in an interpreted language. Project:M36 is the fourth case in that list: it implements the algebra and its own storage in Haskell, with no external database underneath.

That choice buys the thing the README argues for, which is a system whose storage layer is designed to the algebra rather than adapted to it. It also costs you the ability to lean on a mature external database, and it means you are trusting a single implementation's durability and concurrency behaviour. The documentation does not claim to settle that trade, and the assessment documents exist so you can read the arguments rather than take them on trust.

## Public domain, no releases, and a community that predates most of its audience

The project is licensed under the Unlicense, which the README badge labels Public Domain. That means the code can be used, modified and redistributed with no obligation, which is unusually generous for a database engine and removes the usual licence conversation entirely.

On maintenance, the repository is not archived, the last push was on 2026-09-20, and it publishes no GitHub releases. The changelog lives in the repository as Changelog.markdown, so version history is there, but there is no tagged release to pin in a dependency file. The build files tell you the supported toolchain: GHC 9.2 or later, with stack configurations for 9.4 and 9.6, and Nix and cabal support alongside them.

The community channels are old school and unusually complete for a project of this size. There is an IRC channel on irc.libera.chat, a Google group, a developer's blog, a Hackage package with a dependency status badge, a CI workflow badge, a course for SQL developers on TutorialD, and a video tutorial by Diogo Biazus. The Jupyter notebook kernel and the Persistent driver integration suggest the project is used by people who already work in Haskell.

For a database, the honest summary is this. It is a complete, opinionated engine in the public domain that you can run in a container, and it is best used either as a teaching instrument or as an embedded store in a Haskell application. It is not the choice for a team that needs its existing SQL application to work unchanged.

## Conclusion

Adopt Project:M36 if you want to learn the relational algebra properly, if you need a small embedded database in a Haskell application, or if you want a reference implementation of the ideas in The Third Manifesto and Out of the Tarpit. Do not pick it as a drop-in SQL server for an existing application, since SQLegacy is explicitly a dialect for learning rather than compatibility. Before you commit, note that it is public domain, that the last push was on 2026-09-20 with no GitHub releases, and that it is built with GHC 9.2 or later.

## FAQ

### How do I run Project:M36 without installing Haskell?

Use Docker. Run docker run -it projectm36/project-m36 tutd for the TutorialD interface, or docker run -it projectm36/project-m36 sqlegacy for the SQL dialect, and the README states this works on Windows 10 and later, macOS and Linux.

### What is the difference between TutorialD and SQLegacy in Project:M36?

TutorialD is the language of the relational algebra itself and is used to learn the algebra, while SQLegacy is a SQL dialect that exists so you can learn how SQL differs from the relational algebra.

### Can Project:M36 be used as a database server as well as a library?

Yes. The README states it can be used as an in-process or remote DBMS, and the documentation includes a server mode guide, a WebSocket server guide, a Jupyter notebook kernel and a client library.

### What licence does Project:M36 use?

It is released under the Unlicense, which the README badge labels as Public Domain, so there is no attribution or copyleft obligation on code you reuse.

### What compiler does Project:M36 need?

The development notes say the project is developed in Haskell and compiled with GHC 9.2 or later, with stack configuration files present for GHC 9.4 and GHC 9.6.

## Sources

- [agentm/project-m36 on GitHub](https://github.com/agentm/project-m36)
- [Issues](https://github.com/agentm/project-m36/issues)
- [License: Unlicense](https://github.com/agentm/project-m36/blob/master/LICENSE)
- [README](https://github.com/agentm/project-m36/blob/master/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/agentm-project-m36
