Skip to content

libvibe 1.1.0 β€” VIBE is now a real C library 🌊

Latest

Choose a tag to compare

@1ay1 1ay1 released this 20 Jul 16:28

libvibe 1.1.0 β€” the reference implementation is now a real C library

VIBE's C reference parser graduates to libvibe: an installable static +
shared library, a vibe CLI, an emitter, stable error codes, and enforced
resource limits β€” all 100% source-compatible with the previous API. The
VIBE format itself is unchanged (still 1.0).

Install

git clone https://github.com/1ay1/vibe && cd vibe
make && sudo make install
cc app.c $(pkg-config --cflags --libs vibe) -o app

The vibe CLI

vibe check config.vibe        # validate; structured error on failure
vibe fmt   config.vibe -w     # canonical reformat, in place
vibe get   config.vibe server.port

Library highlights

  • πŸ“¦ Static (libvibe.a) + versioned shared (libvibe.so.1, .dylib on macOS) library, a vibe.pc pkg-config file, and make install / uninstall
  • ✍️ Emitter: vibe_emit() / vibe_emit_file() serialise a value tree back to canonical VIBE (idempotent fmt)
  • 🧡 Length-aware vibe_parse_buffer() and stateless one-shot vibe_parse()
  • 🧯 Stable error codes on the API (VibeErrorCode + vibe_error_code_string()), matching the spec's ten categories 1:1
  • πŸŽ›οΈ Configurable, enforced VibeLimits (spec-minimum defaults) β€” fails closed on untrusted input
  • πŸ”Œ Pluggable allocator, version queries, vibe_value_clone(), *_or defaulted getters, vibe_type_name(), container-size helpers
  • 🏷️ extern "C" + -fvisibility=hidden: the shared object exports only the 48 public vibe_* symbols

Hardening

  • ctype calls take unsigned char (no UB on bytes β‰₯ 0x80); quoted strings use a growable buffer (was a fixed 4 KiB stack cap); allocation-failure paths no longer leak or crash; a leading UTF-8 BOM reports encoding-error
  • Clean under -Wall -Wextra -Werror -pedantic and ASan/UBSan

Quality

  • 25/25 unit tests Β· 18/18 conformance (tree-equality on valid, error-category on invalid) Β· committed make conformance runner Β· CI now runs the unit suite, conformance, a CLI smoke test, and a dedicated ASan/UBSan job

Docs & website

Full changelog: https://github.com/1ay1/vibe/blob/main/CHANGELOG.md