Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

yo-kit

The binding kit for yo, an embedded multi-model database that lives in one .yo file. It produces a working binding for a new language from the API model plus a per-language template.

Status

Nothing here yet. This repository is empty apart from this file, and it stays that way until the API model it reads is stable enough to generate against.

The generator's input is api.model.json, which is emitted from the engine's Rust source and published as a release asset. That model is still moving. A generator pinned to a moving model produces bindings that break on every release, which is worse than no generator, so this one waits.

Scheduled for DX7, alongside M8. Watch the milestones.

What it is for

There are six tier-1 languages and six tier-2 languages, and each of those has a repository, a maintainer and a release train. Everything past that is tier 3: Ruby, PHP, R, Elixir, Zig, Julia, Perl, Nim, OCaml, Haskell, browser WebAssembly and Swift on Android. Maintaining eighteen bindings by hand is not a plan. This is how tier 3 exists at all.

What it emits

  1. The FFI declarations for whatever mechanism the target has, whether that is a dlopen wrapper, a ctypes-style surface or a native FFI.
  2. The error enum, the code table, the retryable flags and the documentation URLs.
  3. The shape description encoder. This is the one piece a hand-written binding gets subtly wrong, and when it is wrong by a single byte the failure surfaces as a file one language cannot read that another wrote, which is very hard to debug from the symptom.
  4. The plan encoder.
  5. Arena and batching scaffolding.
  6. A test harness that runs the conformance corpus and prints a per-section score.
  7. A README skeleton with a slot for the 60-second snippet and a tier-3 label already in it.

What it does not emit

The idiom. That is the point of the split rather than a limitation of the tool.

The generator hands a maintainer the mechanical seventy percent, and the interesting thirty percent is theirs to write, because the idiom is the product. A binding that is pure generator output works, and it is labelled as such so nobody has to guess which kind they are looking at.

The score

Every tier-3 binding publishes its conformance corpus score, and the scores sit on the documentation site next to the tier table.

A binding at sixty percent is more useful than no binding, provided the sixty percent is visible. A template with no maintainer is listed as "template available, unmaintained", which is more useful than an empty row.

Design

dx/09 §3 is the specification for this repository, and dx/03 is the model it generates from.

Licence

Apache 2.0 or MIT, at your option.

About

Binding kit for yo, the embedded knowledge engine: generated FFI declarations, the shape encoder, conformance runners, templates for a dozen languages, and the scorecard tool

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors