Skip to content

runtime: DEFLATE inflate (zlib) for reading compressed archives (.xlsx, .ods, .gz) #684

Description

@InauguralPhysicist

Gap surfaced by a consumer (eigen-sheet #16, xlsx interop).

EigenScript has enough to write compressed-container formats: byte I/O
(write_bytes over a 0-255 list), bitwise ops (bit_xor/bit_and/bit_shr,
enough for a hand-rolled CRC32), and buffers. eigen-sheet now writes a real
.xlsx by assembling a stored (uncompressed) ZIP of OOXML parts — Excel and
LibreOffice open it.

But reading real-world .xlsx / .ods / .gz needs DEFLATE inflate
Excel/LibreOffice always deflate their ZIP entries, and there is no
decompressor in the runtime. Hand-rolling inflate in pure EigenScript
(Huffman + LZ77 sliding window) is possible but heavy and slow, and it's a
fundamental primitive many consumers will want.

Proposed: a builtin inflate of bytes -> bytes (raw DEFLATE) and/or
zlib_inflate (zlib-wrapped), plus optionally deflate for compact writes.
A thin wrapper over the system zlib (already a common dependency) would do it;
keep it optional/extension-gated to preserve the zero-dependency minimal build.

Consumer impact: unblocks eigen-sheet #39 (xlsx/ods IMPORT). Also the natural
primitive for a gzip codec, any archive reader, HTTP gzip response bodies, etc.

Requested by the eigen-sheet Calc-parity work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions