Skip to content

feature - complete std.compression RFC (#339, #548)#582

Merged
dannymeijer merged 12 commits into
mainfrom
feature/339-implement-rfc-061-std-compression
May 18, 2026
Merged

feature - complete std.compression RFC (#339, #548)#582
dannymeijer merged 12 commits into
mainfrom
feature/339-implement-rfc-061-std-compression

Conversation

@dannymeijer
Copy link
Copy Markdown
Contributor

@dannymeijer dannymeijer commented May 15, 2026

Summary

This PR completes RFC 061 std.compression and keeps the implementation dogfooded through source-authored Incan stdlib modules. It now covers one-shot and stream compression/decompression for gzip, zlib, deflate, zstd, bz2, lzma, framed Snappy, raw Snappy interop, explicit autodetection, generated-project compile coverage for issue #548, public reference and how-to docs, release notes, and moves RFC 061 to closed/implemented for 0.3.0.

Type of change

  • Bug fix
  • New feature
  • Refactor / maintenance
  • Documentation
  • CI / tooling
  • RFC (adds/updates docs/RFCs/*)

Area(s)

Select the primary areas touched (used for review routing; labels are managed separately):

  • Incan Language (syntax/semantics)
  • Compiler (frontend/backend/codegen)
  • Tooling (CLI/formatter/test runner)
  • Editor integration (LSP/VS Code extension)
  • Runtime / Core crates (stdlib/core/derive)
  • Documentation

Key details

  • User-facing behavior: std.compression now exposes the RFC baseline codec APIs, including compress, decompress, compress_stream, decompress_stream, decompress_auto, decompress_auto_stream, shared Codec / CompressionError vocabulary, framed Snappy defaults, and raw Snappy under std.compression.snappy.raw.
  • Internals: the compression modules stay source-authored in Incan rather than adding new Rust extern type implementations; the stream paths use BytesIO | File branches and shared stdlib helpers, and the generated-project test now builds/runs the nested Cargo output that originally failed in bug - Generated stdlib modules fail Rust build for source-defined sibling imports #548.
  • Risks: the stream implementation intentionally uses concrete BytesIO/File branches until the compiler can lower a generic reader/writer helper without imposing backend-incompatible bounds. Codec behavior is covered by the fixture, but deeper cross-tool compatibility remains normal stdlib surface risk.

Testing / verification

  • make test / cargo test
  • make examples (if relevant)
  • incan fmt --check . (if relevant)
  • Manual verification described below

Manual verification notes:

  • git fetch origin main
  • git merge origin/main
  • cargo build --bin incan
  • incan build tests/fixtures/valid/std_compression_surface.incn
  • target/incan/.cargo-target/release/std_compression_surface
  • cargo test --test codegen_snapshot_tests test_std_compression_modules_compile_codegen -- --nocapture
  • cargo test --test integration_tests test_std_compression_surface_runs_generated_project -- --nocapture
  • make docs-build
  • make fmt
  • make pre-commit passed, including full nextest suite, clippy, cargo-deny, and smoke-test-fast.
  • Source-quality and architecture review/fix loops completed with no remaining findings.

Docs impact

  • No docs changes needed
  • Docs updated
  • Docs follow Divio intent (tutorial/how-to/reference/explanation) where applicable

If docs updated:

  • Link(s): workspaces/docs-site/docs/language/how-to/compression.md, workspaces/docs-site/docs/language/reference/stdlib/compression.md, workspaces/docs-site/docs/RFCs/closed/implemented/061_std_compression.md, workspaces/docs-site/docs/release_notes/0_3.md

RFC lifecycle state: RFC 061 is implemented, moved to workspaces/docs-site/docs/RFCs/closed/implemented/061_std_compression.md, and marked shipped in 0.3.0.

Checklist

  • I kept public docs user-focused and moved internals to contributing docs when appropriate
  • I avoided duplicating canonical install/run instructions in multiple places
  • I added/updated tests where it materially reduces regressions

Closes #339
Fixes #548

@incan-triage-bot incan-triage-bot Bot added documentation Improvements or additions to documentation incan compiler Suggestions, features, or bugs related to the Compiler (frontend/backend/codegen) incan language semantics Suggestions, features, or bugs related to the Incan Language itself (syntax and semantics) runtime / core crates Suggestions, features, or bugs related to the `incan-core`, `incan-stdlib`, 'incan-derive` crates labels May 15, 2026
@dannymeijer dannymeijer changed the title feature - implement std.compression one-shot codecs (#339, #548) feature - complete std.compression RFC (#339, #548) May 18, 2026
@dannymeijer dannymeijer self-assigned this May 18, 2026
@dannymeijer dannymeijer added this to the 0.3 Release milestone May 18, 2026
@dannymeijer dannymeijer marked this pull request as ready for review May 18, 2026 10:47
@dannymeijer dannymeijer merged commit 06cb475 into main May 18, 2026
33 checks passed
@dannymeijer dannymeijer deleted the feature/339-implement-rfc-061-std-compression branch May 18, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation incan compiler Suggestions, features, or bugs related to the Compiler (frontend/backend/codegen) incan language semantics Suggestions, features, or bugs related to the Incan Language itself (syntax and semantics) runtime / core crates Suggestions, features, or bugs related to the `incan-core`, `incan-stdlib`, 'incan-derive` crates

Projects

None yet

1 participant