Repository navigation
Add the comline-catalog Rust crate - #2
Merged
Merged
Conversation
added 2 commits
November 9, 2026 22:29
rust/ is a no_std, dependency-free crate holding the catalog as Rust constants and tables: guarantees, facts with their values, the official encodings with aliases and frozen spellings, features, sets and SPEC_VERSION. Its types and lookups are hand-written; its data, rust/src/catalog.rs, is generated from the CUE (catalog/rust.cue) by specs/check.sh, which fails on a stale copy. CI tests it on stable, checks it on Rust 1.82 and builds it for wasm32.
This was referenced Nov 9, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first step of core reading the catalog (ComlineProject/core#219 rollout, stage 2): the catalog as a Rust crate that core, and later the runtime and the language server, depend on by git rev.
rust/,comline-catalog:no_std, has no dependencies, and supports Rust 1.82 (core's MSRV). It builds for wasm32, so core's IR-only build can use it.Guarantee,Fact,Value,Encoding,Feature,Kind,Origin,Status) and the lookups (guarantee,fact,facts_of,encoding,resolvefor a wire name or an alias,feature) are hand-written inlib.rs.src/catalog.rs: theGUARANTEES,FACTS,ENCODINGSandFEATUREStables in catalog order, id constants (encoding::PACKED_1,guarantee::BOUNDED_SIZE, and so on), every set withALIASES, andSPEC_VERSIONfromVERSION.catalog/rust.cuegenerates the data with plain CUE string interpolation, so no other toolchain is needed. Template maps would sort the keys, and the order matters. Strings are raw literals, and the catalog refuses any text containing"#. Constant names must be unique within each kind.specs/check.shwritesrust/src/catalog.rs, and with--checkfails when it is stale. It passesVERSIONin as a CUE tag.rust cratejob: tests and clippy (-D warnings) on stable,checkon 1.82.0, and a wasm32 build.Tested locally:
check.sh --check,cargo test(5 tests), clippy clean,cargo +1.82.0 check, and a wasm32 build.Next: core depends on it and reads guarantees, facts, aliases and frozen spellings from it, with tests that its hand-written
Guaranteematches the catalog exactly.