Welcome to the technical reference for the Retargetable ISA Foundry (RIF). This document outlines the operational principles and workflow of the system.
What is RIF?
RIF is a retargetable generator designed to define assemblers, packers, and linkers through packages (.pack) and Python plugins.
The system's architecture is based on an agnostic core that contains no hardware-specific rules. The core is responsible for:
- Processing data structures and tables.
- Executing common DSL instructions.
- Resolving placeholders and memory labels.
- Organizing sections and delegating concrete semantics to installed plugins.
Workflow (Quick Start)
To work with RIF, a .pack file is defined to describe the world, registers, instruction rules, and memory configuration.
Compiling an isolated instruction:
python -m rif compile examples/minimal.pack byte 0xf
This allows for quick verification of the binary output (bits/hex) of a specific instruction.
Building a complete project:
python -m rif build examples/minimal.pack --source-text "byte 0x2a"
Or simply pointing to a folder containing the architecture definition:
python -m rif build gba
Plugin System and Tools
RIF allows extending its capabilities through plugins that add commands to the CLI:
python -m rif -pcli fonts list: Lists available glyphs in the fonts plugin.python -m rif help instructions: Opens local documentation about instruction syntax.
The ultimate goal of RIF is to allow any new architecture to be fully integrated into the tool ecosystem without needing to modify the engine's original source code.