All notable changes to zaml are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.2.0 - 2026-10-09
Changed
Performance. Maps are now built with a single
enif_make_map_from_arrayscall per map instead of a per-pairenif_make_map_put, eliminating the O(n^2) rehashing on wide maps. String scalars are now returned as sub-binaries of the input (enif_make_sub_binary) rather than copied into freshly allocated binaries, so the parse no longer re-copies every string value. Together these take the 100k-key nested benchmark from ~0.65 s to ~0.53 s and shave the 1M-key flat benchmark to ~0.84 s, keeping the lead overfast_yamlat ~3.0–3.5×.The sub-binary path is guarded: we only sub-binary when the scalar pointer provably lies inside the input buffer, falling back to a copy otherwise, so the change stays correct across libyaml versions that may write quoted/block/folded scalars into their own buffer.
Fixed
- Anchors and aliases.
&nameis now registered for scalars and for mapping/sequence starts, and*nameresolves to the aliased term. Anchor names are copied into a parse-scoped arena because libyaml frees the event buffer after each event. Previously any document using an anchor returned:parse_error.
0.1.0 - 2026-09-05
Added
- Elixir NIF: a Zig NIF wrapping libyaml for
fast YAML 1.2 parsing in Elixir.
Zaml.load/1parses a YAML binary and returns the corresponding Elixir term (maps, lists, integers, floats, booleans,:nil).- YAML 1.2 core schema scalar resolution for ints, floats, bools, and null.
- Respects explicit
!!str/!!int/!!float/!!bool/!!nulltags. - Anchors and aliases (
&name/*name). - Returns
:errorfor non-binary input,:parse_errorfor malformed YAML, and:nilfor an empty document.
- NIF is compiled at
mix compileviaelixir_makeand the projectMakefile(also invokable as Mix taskZamlNif.Build). mix zaml_nif.bench PATHMix task for head-to-head benchmarking againstfast_yaml.Makefiledriving thezig build-libinvocation directly, withpkg-config/Homebrew//usrlibyaml auto-detection.mix.exsauto-detectslibyamlon common paths and exportsCFLAGS/CPPFLAGS/LDFLAGSso rebar3-compiled deps (e.g.fast_yamlin the bench task) find it.- ExUnit test suite covering basic scalars, nested maps and lists, explicit tags, anchors, empty input, and parse-error handling.
- Cross-language benchmark suite (
benchmark/) comparing the NIF againstfast_yaml, PyYAML, andruamel.yaml. benchmark/RESULTS.mdwith the measured numbers on a 1M-line flat mapping and a 100k-key nested mapping.
Notes
- Merge keys (
<<: *alias) are not yet expanded. - Multi-document input returns only the first document.