Zarr v2 and v3 chunked array storage for MoonBit
Dependencies
| Capability | Zarr v2 | Zarr v3 |
|---|---|---|
| Parse regular-grid array metadata | Yes, common string dtypes | Yes, common string data types |
| Metadata and chunk keys | . and / separators | default and v2-compatible encodings |
| Raw encoded chunk storage | Memory and native filesystem | Memory and native filesystem |
| bool element and slice I/O | Memory and native filesystem | Memory and native filesystem; bytes codec |
| uint8 element and slice I/O | Memory and native filesystem; C/F order | Memory and native filesystem; bytes codec |
| int8 element and slice I/O (Int API, range-checked) | Memory and native filesystem; C/F order | Memory and native filesystem; bytes codec |
| uint16 element and slice I/O | Memory and native filesystem; little/big endian, C/F order | Memory and native filesystem; little/big endian bytes codec |
| int16 element and slice I/O | Memory and native filesystem; little/big endian, C/F order | Memory and native filesystem; little/big endian bytes codec |
| uint32 element and slice I/O | Memory and native filesystem; little/big endian, C/F order | Memory and native filesystem; little/big endian bytes codec |
| float64 element I/O | Memory and native filesystem; little/big endian, C/F order | Memory and native filesystem; little/big endian bytes codec |
| float32 element I/O | Memory and native filesystem; little/big endian, C/F order | Memory and native filesystem; little/big endian bytes codec |
| int32 element I/O | Memory and native filesystem; little/big endian, C/F order | Memory and native filesystem; little/big endian bytes codec |
| int64 element and slice I/O | Memory and native filesystem; little/big endian, C/F order | Memory and native filesystem; little/big endian bytes codec |
| uint64 element and slice I/O | Memory and native filesystem; little/big endian, C/F order | Memory and native filesystem; little/big endian bytes codec |
| Rectangular slice I/O (all listed types) | Memory and native filesystem | Memory and native filesystem |
| gzip compression (levels 0–9) | Read/write | Read/write after bytes codec |
| zstd compression (levels 0–22) | Read/write | Read/write after bytes codec, with or without frame checksum |
| zlib compression (levels 0–9) | Read/write | Not a v3 core codec |
| Blosc1 frames (LZ4/LZ4HC/Zlib/Zstd; no, byte or bit shuffle) | LZ4 read/write; LZ4HC/Zlib/Zstd read-only; BloscLZ unsupported | LZ4 read/write after bytes codec; LZ4HC/Zlib/Zstd read-only; BloscLZ unsupported |
| Other dtypes, filters and codecs | Planned | Planned |
| Groups, ancestors and attributes | Memory and native filesystem (.zgroup/.zattrs) | Memory and native filesystem (zarr.json) |
| Consolidated metadata | Read-only native .zmetadata snapshot | Read-only native inline root zarr.json snapshot (zarr-python convention) |
| HTTP read-only regional hydration | Native, bounded metadata/chunk downloads | Native, bounded metadata/chunk downloads |
| Cloud object-store adapters | Planned | Planned |
git clone https://github.com/zlhahaha/zarr.git
cd zarr
moon update
moon run --target wasm-gc cmd/main
moon run --target native cmd/native_demo
moon run --target native cmd/v2_demomoon check --deny-warn
moon build
moon test --deny-warn
moon run cmd/main
moon test --target native --deny-warn
moon run --target native cmd/native_demo
moon run --target native cmd/v2_demometadata/ Parse and validate v2/v3 array and group documents
chunk/ Regular-grid indexing and metadata/chunk keys
dtype/ Numeric dtype and fill-value checks
codec/ Codec-chain validation and bounded gzip/zlib/zstd decode
store/ In-memory encoded-byte store
store/fs/ Native-only filesystem store
store/http/ Native-only read-only HTTP regional hydration
array/ Typed array creation, element and region I/O
hierarchy/ Group and attribute operations
integration/ Cross-package tests
cmd/main/ Portable in-memory v3 example
cmd/native_demo/ Native filesystem v3 example
cmd/v2_demo/ Native filesystem v2 exampleInstall
Download zipZarr v2 and v3 chunked array storage for MoonBit
Dependencies