Skip to main content

Module format

Module format 

Source
Expand description

FMIR binary format definition and parsers.

Defines the on-disk layout for Forma Module IR files:

  • 16-byte header (magic, version, flags, source hash)
  • 32-byte section table (4 sections x 8 bytes each)
  • Opcode, SlotType, IslandTrigger, PropsMode enums
  • SlotEntry and IslandEntry structs

All multi-byte integers are little-endian.

Structs§

IrHeader
FMIR file header — the first 16 bytes of every .fmir file.
IslandEntry
An island declaration in the island table.
SectionDescriptor
A single section descriptor: offset + size (both u32, little-endian).
SectionTable
Section table — four section descriptors immediately following the header.
SlotEntry
A slot declaration in the slot table.

Enums§

IrError
Errors that can occur when parsing FMIR binary data.
IslandTrigger
When an island should be hydrated.
Opcode
Bytecode opcodes for the FMIR instruction stream.
PropsMode
How island props are delivered.
SlotSource
Where the slot value originates at runtime.
SlotType
Data type hint for a slot entry.

Constants§

HEADER_SIZE
Size of the file header in bytes.
IR_VERSION
Current IR format version.
MAGIC
Magic bytes identifying an FMIR file.
SECTION_TABLE_SIZE
Size of the section table in bytes (4 sections x 8 bytes).