Moved (23 October 2026). This repository now lives in
openIE-dev/rceasprograms/, with its full history, so that it is checked from the same commit as the specification and the reference checker and can no longer drift from them. Changes go there; this repository is kept only as a pointer.
Programs written in RCE, grouped by what they are for: simulated worlds, control of physical devices, media, networks, text, data, money, science, systems and hardware. Each program is small enough to read in one sitting, carries its own tests, and is checked by the RCE reference checker.
In plain words:
- Each folder is one kind of problem. Pick the area closest to what you want to build and start from its programs.
- Each program tests itself. The
exampleandchecklines inside a program say what it must do, and the checker refuses the program if they do not hold. - The limits are written down. Where RCE cannot yet express something an area needs, the folder's README says so plainly.
Build rce from the rce repository
or download it with the desktop IDE from the
rce-ide releases page,
then:
git clone https://github.com/openIE-dev/rce-examples
cd rce-examples
rce test money/account.rce
rce run systems/ring_buffer.rce "Push(v: 7), Push(v: 8), Pop, Pop, Pop"To check a program without installing anything, paste it into the RCE playground.
To check every program in the repository:
RCE=/path/to/rce scripts/check.sh| Folder | Programs | What they show |
|---|---|---|
| world/ | cellular_automaton.rce, queue_sim.rce |
discrete simulation as a state that changes on each event |
| body/ | thermostat.rce, arm.rce |
control loops that react to sensor readings and refuse impossible ones |
| media/ | gain.rce, moving_average.rce |
fixed-size buffers, lane-wise arithmetic, clipping, filters |
| network/ | handshake.rce, server.rce |
a protocol as a state machine; a server as an actor |
| text/ | word_count.rce, edit_distance.rce |
a byte-by-byte lexer; dynamic programming over text |
| data/ | totals.rce |
records, totals and a group-by |
| money/ | account.rce, ledger.rce |
balances in integer cents; double-entry bookkeeping with an invariant |
| science/ | numerics.rce, knapsack.rce |
dot product, mean, Newton's method; dynamic programming |
| systems/ | ring_buffer.rce, reconcile.rce |
a ring buffer that refuses to overwrite; a reconcile loop |
| hardware/ | bits.rce |
bit counting, bit fields, a CRC-32 table built while checking |
Some kinds of program have no example here, because RCE language version 0.5 (sections 2 to 10 of the specification) has no construct for them:
- Machine learning. There is no tensor type and no automatic differentiation.
- Logic and proof. There is no logic or constraint programming in the
language. (The language itself is modelled in Lean, in the
rcerepository, but that is a proof about RCE, not a feature of it.) - Quantum computing. There is no construct for qubits or circuits.
scripts/check.sh applies four rules: a program outside a refused/
folder must pass rce test; a program in refused/ must be refused with
the text in its .expect file; a .cmd file holds a command whose
output must equal the .out file next to it; and a folder with a
program.txt is tested as one program.
All programs are version 0.5 modules (sections 2 to 10 of the specification).
They were last checked on 17 October 2026 against public openIE-dev/rce main
(e416fd0, specification draft 0.9, language versions 0.5 to 0.9): scripts/check.sh
reports 22 passed, 0 failed with the public checker. The ecosystem/ programs that
name a #!lib library need the rce binary of rce-ide 0.1.3 or later, which embeds
those libraries.
New examples are welcome; see CONTRIBUTING.md. Everyone taking part follows the code of conduct.
Copyright (c) 2026 Open Interface Engineering, Inc.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option. Unless you explicitly state otherwise, any contribution you intentionally submit for inclusion in this work shall be dual licensed as above, without any additional terms or conditions.