A unified programming system combining Rio's layered reversible substrate with RioVN's canonical message dispatch, embodying minimization through conceptual unification, synergy, and orthogonality.
This merged system integrates:
- Rio: L4 prototype language with reversible substrate (L4βL2aβL1)
- RioVN: Von Neumann canonicalization with forced hierarchy and governance
- Unified Surface: Two arrows (
->,<-) with optional tags - Philosophy: Reversible by default, explicit D-term boundaries
// Message passing (R-term by default)
math -> add a b
io -> output message
// Inheritance (S-term)
MathProto <- ObjectProto
// Optional tags for D-term boundaries
@irreversible io -> writeToDisk data
@io network -> sendPacket bytesCompilationResult* compile(const char* code, CompilerOptions options);typedef struct {
bool strict_mode; // Enforce explicit D-term boundaries
bool auto_hoist; // Auto-generate synthetic hierarchy
bool debug_mode; // Verbose logging + stats
bool l5_enhanced; // Enable L5 homoiconic features (orthogonal)
} CompilerOptions;- L5 Moop: Natural language homoiconic authoring (unified surface, orthogonal enhancement flag)
- L4 Rio: Prototypes + RioVN canonicalization (inherits homoiconicity from L3)
- L3 Turchin: Actors + D-term coordination membranes (inherits homoiconicity from L2a)
- L2a Prigogine: Reversible functions (R-term, inherits homoiconicity from L1)
- L2b Prigogine: Explicit D-term gates (homoiconic D-term logs, bypasses to L0)
- L1 HRIR: Homoiconic Reversible IR (self-describing operations)
- L0 RISC-V: Hardware execution (inherits reversibility from L1)
- L0 Assembly: Target with reversible execution
L1 HRIR Cells (reversible, homoiconic operations)
β inherits to
L2a Functions (reversible, homoiconic functions)
β inherits to
L3 Actors (reversible, homoiconic actors)
β inherits to
L4 root_proto (reversible, homoiconic prototypes)
- L1 Reversible Tape: System-facing homoiconic execution with checkpoints/rollback
- L2b D-term Membranes: Irreversible logs with event cross-linking
- Time-Travel Debugging: Actor snapshots, undo/redo, selective rollback
- Two operators at surface level
- Single compilation entrypoint
- Optional tags only when needed
- Everything resolves to canonical
Proto.Actor.Func - Single AST with forced hierarchy internally
- Unified send semantics across all layers
- Strict/autoHoist/debug vary independently
- Layers maintain contracts but share surface
- Options compose without conflicts
- RioVN canonicalization + Rio reversibility = auditable system
- Layers cooperate through unified surface
- Governance + replay capabilities combine powerfully
make clean && make
./august_rio_compiler
./august_rio_compiler --debug
./august_rio_compiler --json
./august_rio_compiler --l5-enhanced # Enable L5 homoiconic features
./august_rio_compiler examples/sample.rio --debug --json
./august_rio_compiler examples/hello_l5.moop --l5-enhanced --debug
# Environment variable (orthogonal flag)
export MOOP_L5_ENHANCED=1
./august_rio_compiler examples/advanced_l5.moop --debug
# Demonstrations
make hrir-demo # L1 HRIR homoiconic reversible operations
make consistency-demo # Dual-memory system validation
make python-demo # Python bindings demonstration--debug- Enable verbose debug output--strict- Enforce explicit D-term tagging--json- Output results in JSON format for tooling integration--no-auto-hoist- Disable automatic hierarchy generation--no-reversible- Disable reversible default--l5-enhanced- Enable L5 homoiconic features (orthogonal)file.rioorfile.moop- Load and compile a .rio or .moop file
make all- Build the compilermake test- Run with default demomake debug- Run in debug modemake json- Run with JSON outputmake compile-sample- Compile examples/sample.rio with debug + jsonmake hrir-demo- Build and run L1 HRIR demonstrationmake consistency-demo- Build and run dual-memory consistency checkermake python-demo- Build and run Python bindings demonstrationmake help- Show available targets and options
Rio+RioVN provides a clean C API for embedding the compiler in other applications:
librio.so- Shared library for dynamic linkinglibrio.a- Static library for static linking
#include "rio_api.h"
// Create VM
RioVM* vm = rio_create_vm();
// Compile source code
RioCompileOptions options = rio_default_options();
options.json_output = true;
RioResult* result = rio_compile_string(vm, "MathProto <- ObjectProto\nmath -> add 5 3", options);
// Check result
if (rio_result_success(result)) {
// Access compilation outputs
const char* json = rio_result_json_output(result);
RioStats stats = rio_result_stats(result);
// Homoiconic AST access
RioAST* ast = rio_result_get_ast(result);
RioASTNode node = rio_ast_get_node(ast, 0);
}
// Cleanup
rio_free_result(result);
rio_destroy_vm(vm);- VM Lifecycle: Create/destroy virtual machines
- Compilation: Compile strings or files with full option control
- Result Access: Get canonical code, JSON output, inheritance relations
- Homoiconicity: Runtime AST inspection and manipulation
- Inheritance Registry: Query prototype relationships
- Canonical Paths: Parse and validate Proto.Actor.Func paths
- Memory Management: Automatic cleanup with proper resource handling
make api # Build both shared and static libraries
make api-example # Build and run API usage example| Feature | CLI | API |
|---|---|---|
| Usage | Command-line tool | Library integration |
| Output | Files/stdout | Programmatic access |
| Embedding | N/A | Full C API |
| Homoiconicity | Limited | Full AST access |
| Integration | Shell scripts | Native code |
| Performance | Startup overhead | Direct calls |
// Reversible by default
MathProto <- ObjectProto
CalculatorProto <- MathProto
math -> add 5 3
calc -> multiply result 2
io -> output final// Explicit irreversible operations
@irreversible io -> writeToDisk data
@io network -> sendPacket buffer# Strict mode enforces explicit D-term tagging
./rio_riovn_compiler --strict- All operations are reversible unless explicitly tagged
- State evolves via invertible transforms
- Support for time-travel debugging and rollback
- Information preservation as optimization
- Irreversible operations require
@irreversibleor@iotags - D-term membranes log all irreversible changes
- Strict mode enforces explicit tagging
- Auditable coordination boundaries
- Canonical paths for reflection and policy
- Inheritance cycle detection and validation
- Ambiguity resolution with diagnostics
- Performance optimization through caching
π Bootloader Phase Complete - M1 achieved with file loading, CLI, and JSON output.
- Unified surface layer with two-arrow syntax
- File-based loader for .rio files
- CLI argument parsing (--json, --strict, --debug, etc.)
- JSON output for tooling integration
- Canonical registry demo
- Memory-safe parsing and cleanup
- Inheritance relationship tracking
- Sample programs and examples
- L1 HRIR Implementation: Complete homoiconic reversible intermediate representation
- Dual-Memory Architecture: L1 reversible tape + L2b D-term membranes with cross-linking
- Time-Travel Debugging: Checkpoint/rollback, actor snapshots, undo/redo
- Consistency Validation: Automated checking of L1βL0 side effect reproduction
- Python Bindings: Native Python FFI with exception handling and homoiconic access
- Embeddable C API:
librio.soandlibrio.awith full programmatic control
- CMS Integration: Hook into Swift/JavaScriptCore via JSON API
- Language Bindings: Python, JavaScript, Rust FFI bindings
- IDE Integration: Cursor/VSCode extensions for live feedback
- Tooling Support: LSP server for Rio+RioVN
- Actor/mailbox skeleton with RR scheduler
- Checkpoint API for reversible execution
- Replay driver for time-travel debugging
- Live programming capabilities
- Immediate: Test and validate dual-memory consistency checker
- Short Term: CMS integration via Swift API with HRIR access
- Medium Term: Complete actor runtime with L3 time-travel debugging
- Long Term: IDE integration with visual time-travel debugging
This implementation is grounded in rigorous theoretical foundations documented in moop-docs:
- Refined UME Foundation - R+Ξ (autopoiesis) and S+D (adaptation) duality
- Amplituhedron Computation - Geometric optimization hypothesis
- Quadruple Synergy - How homoiconicity, reversibility, amplituhedron math, and autopoiesis synergize
- Autopoietic-Adaptive Duality - Mathematics of the Ξ β Ξβ² feedback loop
- Homoiconicity: L1 HRIR cells are self-describing, enabling runtime introspection and modification
- Reversibility: L1 reversible tape with checkpoint/rollback capabilities
- Dual Memory: System-facing reversible loops (L1) + user-facing conventional memory (L2b+)
- Autopoietic Substrate: System maintains its organization through the R+Ξ subsystem
- Adaptive Layer: D-term boundaries enable evolution through S+D interactions
Performance expectations (from theoretical analysis):
- Conservative: 2-5Γ from adaptive optimization
- Realistic: 2-10Γ for typical code
- Optimistic: Up to 25Γ for highly structured problems (if amplituhedron hypothesis validated)
- moop-embedded - Quantum-ready embedded runtime (40KB, no GC)
- moop-esp32 - Hardware-tested ESP32-C3 firmware
- moop-docs - Comprehensive documentation and theory
This project embodies the philosophy of minimization through conceptual unification, synergy, and orthogonality. All changes must maintain:
- Minimal surface - Keep syntax surface clean and minimal
- Conceptual unification - Everything resolves to canonical paths
- Orthogonality - Features vary independently
- Synergy - Components work together harmoniously
- Reversibility default - Explicit D-term boundaries only
The merged Rio+RioVN system represents the pinnacle of this philosophy - providing maximal expressive power through minimal, unified design.