Interoperability-focused RoaringBitmap with automatic run compression and portable serialization
moon add xcc-ordinary/moonbit-roaringlet sparse = @roaring.RoaringBitmap::from_array([1U, 100U, 1000U])
let consecutive = @roaring.RoaringBitmap::from_range(0U, 10000U)
let result = sparse.union(consecutive)
// The only exposed wire format is the interoperable portable format.
let bytes = result.serialize()
let restored = match @roaring.RoaringBitmap::deserialize(bytes) {
Ok(bitmap) => bitmap
Err(error) => panic("invalid bitmap: \{error}")
}
let first_three = restored.iter().take(3).to_array()
let count_at_or_below_500 = restored.rank(500U)
let fifth = restored.select(4)moon run examples/inverted_index
moon run examples/portable_window
moon run examples/analyticsmoon info
moon fmt --check
moon check -d
moon test
moon test --target wasm-gc
moon test --target js
moon bench --release --target wasm| Area | kesmeey/RoaringBitmap | moonbit-roaring |
|---|---|---|
| Basic 32-bit set operations | Yes | Yes |
| Array/Bitmap/Run definitions | Yes | Yes |
| Run selection on ordinary mutation paths | Optimizer has no call site at that commit | Integrated into mutations and set operations |
| Roaring portable bytes | Not found at that commit | Tested with official testdata |
| Range API | Inclusive filtering of existing values | Same compatibility API plus half-open construction/mutation |
| Iteration | Callback traversal | Lazy Iter[UInt] |
| Rank | Container-level helper | Bitmap-level rank and select |
| Current toolchain | Pinned commit has old-generic-syntax parse errors on moon 0.1.20260904 | Three-target CI |
impl Show for RoaringErrorpub struct RoaringStats {
total_containers : Int
array_containers : Int
bitmap_containers : Int
run_containers : Int
total_bytes_used : Int
compression_ratio : Double
} derive(Debug)Install
Download zipInteroperability-focused RoaringBitmap with automatic run compression and portable serialization