wireform-core
Shared FFI primitives for wireform format packages
wireform-core
[!CAUTION] wireform is in heavy development and has not been published to Hackage yet. APIs may change.
Shared SWAR / SIMD-accelerated primitives used by every
wireform-* format package. Format-agnostic; the C
sources live in cbits/ and the vendored simde headers in
include/simde/.
What's in here
| Module | Role |
|---|---|
Wireform.Builder | High-performance byte builder (vendored fast-builder engine). |
Wireform.Builder.FastBuilder | Builder internals: DataSink, StreamSink, BuildM, etc. |
Wireform.FFI | C FFI surface (varints, UTF-8 / ASCII / NUL / JSON scanners, …). |
Wireform.Encode.Direct | Shared direct-write encode buffer. |
Wireform.Hash | SIMD-accelerated hashing helpers. |
Builder
Wireform.Builder is the shared byte builder used by all wireform
format packages. It supports O(1) concatenation, direct Handle
output without intermediate ByteString allocation, and streaming
transforms (compression, encryption) that process chunks as the
builder produces them.
Based on fast-builder by Takano Akio (public domain).
This package is intentionally small; it exists so the per-format
packages can share the builder engine and the hottest C kernels
(e.g. validateUtf8SWAR, countPackedVarints, findByte) without
duplicating the __attribute__((target(...))) / simde-features.h
plumbing.
C kernels
Every kernel in cbits/ is tested directly by
c-harness/ — unit, boundary and differential
tests plus libFuzzer targets, under ASan+UBSan (and MSan, valgrind,
guard-page -O3 builds and the clang static analyzer in ci) — not
just through the FFI wrappers. Measured by make -C c-harness coverage:
every kernel here sits at 100% line coverage, and every branch except
fast_rng.c's kernel_random-failure arm — unreachable on Darwin, where
arc4random_buf cannot fail, and covered by the Linux
getrandom-failure tests in CI.
License
BSD-3-Clause. Vendored simde headers carry their own MIT license
under include/simde/simde/COPYING and friends.
- base >= 4.20 && < 5
- bytestring >= 0.11 && < 0.13
- containers >= 0.6 && < 0.9
- ghc-prim >= 0.12 && < 0.14
- template-haskell >= 2.22 && < 2.25
- text >= 2.0 && < 2.2
- vector >= 0.13 && < 0.14
- 0.3.0.0
- 0.2.0.1
- 0.2.0.0
- 0.1.0.0