Skip to main content

Crate patch_prolog_shared

Crate patch_prolog_shared 

Source
Expand description

plg-shared: types used by both the compiler (codegen) and the runtime (query parsing / output) — atom interning, term representation, the operator table, and first-argument indexing keys.

This crate is linked into every compiled Prolog binary via libplg_runtime.a. It must stay dependency-free and lean.

Re-exports§

pub use atom::AtomId;
pub use builtins::BUILTINS;
pub use builtins::BuiltinKind;
pub use builtins::BuiltinSpec;
pub use interner::StringInterner;
pub use span::FileId;
pub use span::Span;
pub use span::Spanned;
pub use stdlib::STDLIB_PL;
pub use term::Clause;
pub use term::FirstArgKey;
pub use term::Term;
pub use term::VarId;

Modules§

atom
Atom identifiers and well-known atoms.
builtins
The builtin / control-construct vocabulary: the single source of truth for which names the language knows, their arities, and a one-line doc each. Reconciled in docs/design/BUILTIN_VOCAB.md.
cell
Tagged 64-bit term words — the single source of truth for the word/cell ABI shared by the runtime (which builds and reads these on the heap) and the compiler (which emits the same encoding into .rodata fact tables and blobs). Keeping the tag values, the << 3 / & 7 split, and the functor-packing layout in ONE place means codegen and runtime can never drift one-sidedly.
interner
String interner mapping atom names to dense AtomIds.
span
Source spans — byte ranges into a source file, for diagnostics and (later) runtime error provenance.
stdlib
The embedded standard library source.
term
Prolog term representation (compiler-side AST).