RIF Documentation
Version:
1.0.0Runtime: Python 3.10+ with Gram
RIF is a retargetable instruction format and compilation framework. A RIF definition describes how an external MIR program is recognized, how values are looked up, and how the final pure binary is emitted.
RIF uses Gram for lexical analysis and
syntax parsing. The RIF frontend turns a .rif definition into compiled Rules;
the MIR runtime then executes those Rules against an external source program.
See the RIF changelog for versioned release notes.
Documentation Index
01. Introduction
Concepts, installation, project layout, and the complete RIF pipeline.
02. Language
The .rif language: declarations, configuration, tables, Rules, values, and
external loads.
03. Compilation
How RIF compiles target definitions, processes external MIR, creates .pack
files, and calls Python extension functions.
04. Execution
Runtime state, bit emission, physical and virtual memory, datastack usage, variants, and diagnostics.
Quick Start
main.rif + program.asm -> program.bin
Compile directly from a RIF definition:
rif main.rif program.asm
Create a precompiled package and use it as the target definition:
rif --pack main.rif
rif main.pack program.asm
The output is a pure binary file. Its default name is derived from the MIR
input, so program.asm produces program.bin unless -o is supplied.