Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

224 Commits

Folders and files

Repository files navigation

comline-rust

The Rust target for Comline — one repo per language, holding that language's codegen, libgen, runtime and std-extra together.

Today: just codegen/ (comline-codegen-rust), extracted from ComlineProject/generation. The FFI / dylib (lib-mode) work is gated pending a rewrite against the current IR (G2c); a runtime and std-extra follow.

codegen/

comline-codegen-rust — frozen IR → Rust source.

  • code — one <namespace>.rs per schema: serde data types, plain traits, C-like enums.
  • lib — a buildable crate: Cargo.toml + src/lib.rs (module tree) + src/<namespace>.rs.

Depends on comline-codegen (the language-neutral contract + Registry) and comline-core (the IR), both by git rev. register(&mut Registry) contributes the generator under rust from version 1.85.0 on (its floor: generated code can't build on older Rust); the Comline CLI composes it into its Registry at startup.

cargo test

The rust_c_ffi/, rust_abi_stable/, lib_gen_rust*/ modules are kept for reference but not built — they target a pre-audit FrozenUnit and need a rewrite, not a port.

Features

What this generator implements, feature by feature. Each claim is checked by the conformance suite in ComlineProject/generation: a supported feature has a fixture that generates and matches its golden output, an ignored one generates exactly what it would without the feature, and an unsupported one is refused with an error naming every use. The full matrix, with the fixtures that prove each claim, is in FEATURES.md.

Feature rust ≥ 1.85.0
structs
structs
✅ supported
enums
enums
✅ supported
optional fields
optional-fields
✅ supported
arrays
arrays
✅ supported
fixed-length arrays
fixed-arrays
✅ supported
fixed arrays over 32 elements, nested
large-fixed-arrays-nested
❌ unsupported: a fixed array over 32 elements renders only as a struct or error field's own, non-optional type (serde's derive stops at 32)
unions
unions
❌ unsupported: Rust has no anonymous sum type to render one as
type aliases
type-aliases
✅ supported
constants
constants
✅ supported
protocols
protocols
✅ supported
errors
errors
✅ supported
functions that throw
throws
✅ supported
validators
validators
✅ supported
imports between schemas
imports
✅ supported
nested namespaces
nested-namespaces
✅ supported
lib mode
lib-mode
✅ supported
external_std
external-std
✅ supported
validate_on_decode
validate-on-decode
✅ supported
JSON-RPC framing
framing-jsonrpc
✅ supported
no handshake
handshake-none
✅ supported
connections
connections
✅ supported
async
async
✅ supported
the packed@1 format
format-packed
✅ supported
the json@1 format
format-json
✅ supported
the msgpack@1 format
format-msgpack
✅ supported
bounds
bounds
✅ supported
single characters
chars
✅ supported

Design

See ComlineProject/docs → Design:

  • Runtime & generation repository structure — why one repo per language
  • Generation — what codegen / libgen / runtime each mean
  • The core ↔ target contract — the boundary this repo builds against

License

GNU General Public License v3.0 only (LICENSE or https://www.gnu.org/licenses/gpl-3.0.html). This generator links comline-core and is part of Comline's GPL toolchain. Copyleft covers the generator, not the code it emits — generated bindings are yours and link only comline-runtime (MPL-2.0). Contributions are GPL-3.0-only. Rationale + per-repo split: design/licensing.md.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages