Skip to content

serialize.elixir 1.0.0 — the serialize wire on the BEAM

Choose a tag to compare

@rowan-claude rowan-claude released this 30 Aug 00:24
· 10 commits to main since this release

The serialize wire on the BEAM. This is the first release of serialize.elixir: the family's bitpacking serializer for Elixir and Erlang, wire compatible with the C++ serialize library — the same bytes, bit for bit, on every platform.

What you get:

  • The full primitive surface: raw bits, ranged integers through 128 bits, bool, bit-transparent float and double, the compressed float, relative integers, alignment, byte blocks, UTF-8 and wide strings, and fixed point across all storage widths in one function — through write, read, and measure streams.
  • Byte-identical wire, proven: the port reproduces the reference's golden wire vectors exactly and passes the full sabotage sweep — every consumed bit of the conformance stream is load-bearing, and hostile bytes never raise.
  • Reads validate everything and refuse as values — {:error, stream}, never an exception — so hostile input is handled in ordinary control flow. Writer contract violations raise ArgumentError.
  • Non-finite IEEE-754 patterns travel bit-exactly as {:nonfinite, bits}, because BEAM float terms cannot hold NaN or infinity; the wire stays fully bit transparent, NaN payloads included.
  • Zero dependencies: ExUnit ships with Elixir, and mix test runs the whole suite on the pinned toolchain. The family benchmark is in-repo, golden gated so it reports nothing on a bad wire.
  • Callable from Erlang as well as Elixir — one port serves the whole BEAM.

USAGE.md teaches every operation with an example that runs; the wire format itself is specified in the C++ repository's STANDARD.md.