Skip to content

feat(stdlib): str.bytes / bytes.to_str / bytes.to_ints bridge - #283

Merged
zaidejjo merged 1 commit into
devfrom
feat/str-bytes
Oct 7, 2026
Merged

zaidejjo merged 1 commit into
devfrom
feat/str-bytes

Conversation

@zaidejjo

@zaidejjo zaidejjo commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Completes the scanning bridge Phase 1 left open: user code can now move between str, [int] bytes and opaque buffers with no new config.

API

  • str.bytes(s) -> [int] — one O(n) copy; plain ints compose everywhere
  • bytes.to_str(vs) -> Result<str> — strict UTF-8 + range errors as .err, identical both backends
  • bytes.to_ints(b) -> [int] — opaque buffers (e.g. fs.read_bytes) as plain ints

Layers (lockstep)

Rust natives + checker sigs (std + short) + C twins + headers + AOT lowering + e2e fixture + parity entry + docs.

Verify

  • e2e (VM) ✓, dual-engine parity (VM+AOT) ✓ — parity caught two divergences pre-merge (error message contents, hard-error vs Result split)
  • zz_stdlib lib green, clippy + fmt clean

str.bytes(s) copies UTF-8 bytes to plain [int] (one alloc, composes
with indexing, snapshots and the bytes.* vocabulary); bytes.to_str
strict-decodes with .err on range/UTF-8 violations identically on VM
and AOT; bytes.to_ints exposes opaque buffers as plain ints.

Layers: Rust natives + checker sigs (std + short), C runtime twins +
headers, AOT lowering, e2e fixture + dual-engine parity, stdlib docs.
Parity caught and fixed two error-message/signature divergences
during development (value-carrying range message, hard-error vs
Result split on element types).
@zaidejjo
zaidejjo merged commit bfde71c into dev Oct 7, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant