sim-text 0.1.0

Neutral exact text values and explicit Unicode projections for SIM.
Documentation
  • Coverage
  • 88.89%
    32 out of 36 items documented1 out of 1 items with examples
  • Size
  • Source code size: 40.39 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.28 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 7s Average build duration of successful builds.
  • all releases: 7s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • sim-nest/sim-foundation
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • boherlin

sim-text

sim-text is the neutral home for exact text values whose representation is not restricted to Unicode scalar strings. It will own the shared UTF-16 code-unit value used by JavaScript, codecs, and the future JVM implementation.

CodeUnitString owns the neutral implementation: borrowed raw-unit access, code-unit indexing and slicing, surrogate-pair-aware iteration, and checked conversion to scalar Unicode. It preserves lone surrogates and NUL exactly. sim-value remains focused on construction and access ergonomics for kernel Expr values.

Reuse and dependency ledger

Need Existing anchor Disposition
Exact UTF-16 storage, indexing, slicing, paired iteration, checked scalar conversion sim-runtime/crates/sim-lib-lang-javascript/src/text.rs and its law_fixtures Reuse by move; JavaScript retains a compatibility adapter.
Canonical scalar text and bytes sim-kernel Expr::String and Expr::Bytes Reuse as projections; do not extend the kernel with foreign-text policy.
Expression construction and text/path editing sim-foundation/crates/sim-value/src/lib.rs, edit.rs, and path.rs Keep separate; these are Expr ergonomics, not exact foreign-text storage.
Expression codecs and read construction installed sim-codecs expression codecs and the standard read-construct protocol Reuse existing protocols; exact text does not create a parallel codec family.
UTF conversion Rust str::encode_utf16 and String::from_utf16 used by the JavaScript anchor Reuse, preserving the typed rejection of lone surrogates.

The complete planned direct consumer set is: the codec implementation(s) in the sim-codecs workspace, the JavaScript adapter in the sim-runtime workspace, and the future JVM crate. None is a dependency of sim-foundation: the new crate has no dependencies, and the sim-foundation workspace manifest contains no dependency on sim-codecs, sim-runtime, or a JVM crate. The edge therefore points only from each higher consumer to sim-text; there is no back edge or dependency cycle.

Documentation and validation

From the sim-foundation checkout:

The representation is a small foundation primitive. Rustdoc and the moved law fixtures are its documentation and executable specimen lanes; it has no recipe directory because higher-level consumers own the runnable integration stories.

cargo test -p sim-text
RUSTDOCFLAGS="-D warnings" cargo doc -p sim-text --no-deps
cargo run -p xtask -- check-recipes
cargo run -p xtask -- simdoc --check