x07import
x07import is a deterministic importer that translates a restricted subset of Rust/C into X07 module files (.x07.json, x07AST JSON).
For an end-to-end tutorial that produces a publishable package, see: Porting by example.
Memory model note (ABI v2):
- Prefer
bytes_viewfor read-only byte inputs in imported signatures (borrowed, zero-copy), and return ownedbytes(drop-clean). - Finalize
vec_u8builders withstd.vec.as_bytes(wrapsvec_u8.into_bytes).
Commands
- Import a single file:
- Rust:
x07import-cli rust --in <src.rs> --module-id <module.id> --out modules/ - C:
x07import-cli c --in <src.c> --module-id <module.id> --out modules/
- Rust:
- Batch drift check (no writes):
x07import-cli batch --manifest <manifest.json> --check
Diagnostics
See: Diagnostics catalog.
Frontends
- Rust:
syn::parse_filesubset (seecrates/x07import-core/src/rust/mod.rs). - C: parsed via
clang -Xclang -ast-dump=jsonsubset (seecrates/x07import-core/src/c/).- Supported sources must use
static inlinefunctions and avoid preprocessor directives beyond#include <stdint.h>/<stddef.h>/<stdbool.h>. - Requires
clanginPATH.
- Supported sources must use