Skip to content
This repository was archived by the owner on Oct 23, 2026. It is now read-only.
openIE-devPublic archive

About

Example RCE programs grouped by area, each checked by rce.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Moved (23 October 2026). This repository now lives in openIE-dev/rce as programs/, 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.

RCE examples

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:

  1. Each folder is one kind of problem. Pick the area closest to what you want to build and start from its programs.
  2. Each program tests itself. The example and check lines inside a program say what it must do, and the checker refuses the program if they do not hold.
  3. The limits are written down. Where RCE cannot yet express something an area needs, the folder's README says so plainly.

Quickstart

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

Areas

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

Areas without examples yet

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 rce repository, but that is a proof about RCE, not a feature of it.)
  • Quantum computing. There is no construct for qubits or circuits.

How the checks work

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.

Contributing

New examples are welcome; see CONTRIBUTING.md. Everyone taking part follows the code of conduct.

License

Copyright (c) 2026 Open Interface Engineering, Inc.

Licensed under either of

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.

About

Example RCE programs grouped by area, each checked by rce.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages