Download
One reference implementation, in C — bindings wrap it for other runtimes; anvil.js is the pure-JavaScript implementation for Node and browsers. Pick what matches where your code runs.
v0.14.1-rc is the current release, for all four downloads.
It refuses a $ reference that leads back to a value that contains it (error 4054), and the .NET and Python
downloads now carry the v0.14 changes, including the breaking rule that only a top-level statement may have a base (4022).
See the changelog for the changes and the known issues before you upgrade.
Native library — C / C++
libanvil.a)
and shared (libanvil.so) release builds, plus the public headers. Linux
x86_64 only today; other platforms build from source until real cross-platform CI
exists.
tar -xzf anvil-v0.14.1-rc-linux-x86_64.tar.gz
gcc your_program.c -I anvil-v0.14.1-rc-linux-x86_64/include \
-L anvil-v0.14.1-rc-linux-x86_64/lib -lanvil -o your_program
JavaScript — anvil.js (Node and browsers)
isNull(), and matches Anvil Native on the shared conformance
corpora: the reader (1,920 cases), the writer (851 of 867), the builder (933 of 986) and the schema and
type registry (561 of 561). The other writer cases (16) and builder cases (53) are C-API-only, because they
pass a null, a handle of another builder or text that is not valid UTF-8, which JavaScript cannot
express. value() writes a safe integer as an integer, and
setIo({ read(path) }) lets a browser resolve include from files you supply.
Small documents are slower than in the Node.js binding; the
bindings guide lists the measured gaps.
It replaces the Node.js and WebAssembly downloads below, which stay downloadable at
v0.11.0-rc.
npm install ./anvil.js-v0.14.1-rc.tar.gz
import { parse, AnvilWriter, AnvilBuilder, TypeRegistry, Schema, AnvilDialect } from 'anvil.js'; // or: const anvl = require('anvil.js')
const doc = parse('#!aml\nfoo := 1;');
doc.get('foo').asInt(); // 1
const w = AnvilWriter.create(AnvilDialect.AML);
w.statement('foo').value(1).finish(); // writes foo := 1;
In a browser, without a bundler, use dist/anvil.mjs
(ES module) or dist/anvil.global.js (a <script> tag that
defines window.anvl) from the tarball.
.NET — C#
Anvil.Net.dll) built directly on Anvil Native's vtable ABI, plus the
native library it links against. Linux x64 (glibc) only today. There is no NuGet package, so
reference the assembly directly; other platforms build from source.
Given a config.anvl like this:
server := {
host := localhost;
port := 8080;
};
using Anvil.Net;
using var doc = AnvilDocument.Load("config.anvl");
var server = doc.FindValue("server");
server["port"].AsInt(); // 8080
Python — ctypes
ctypes
binding built directly on Anvil Native's vtable ABI, plus the native library it links
against. No compiled extension module. Linux x64 (glibc) only today; not on PyPI,
so put the extracted src directory on PYTHONPATH; other platforms build from source.
tar -xzf anvil-py-v0.14.1-rc-linux-x64.tar.gz
export PYTHONPATH="$PWD/anvil-py-v0.14.1-rc-linux-x64/src:$PYTHONPATH"
from anvil import AnvilDocument
with AnvilDocument.load("config.anvl") as doc:
server = doc.find_value("server")
server["port"].as_int() # 8080
Previous builds — Node.js* and WebAssembly* (Unsupported; v0.11.0-rc, no further updates)
These two are frozen at v0.11.0-rc and replaced by anvil.js. They stay downloadable at their existing addresses and nothing about them changes.
* Unsupported: frozen at v0.11.0-rc and no longer updated; replaced by anvil.js. The v0.11.0-rc downloads stay available.
WebAssembly* (Unsupported) — browser, or any JS host
dist/) and
a JS-facing wrapper (lib/index.js), with the same API as the Node binding
below, including types, schema and the writer, plus a prebuilt browser bundle
(dist/anvil.browser.js) for a plain <script> tag. Runs on
any WebAssembly host. Module loading is async (WASM instantiation) — see the
bindings guide for the one-line difference.
const anvil = require('anvil-wasm');
await anvil.ready();
const doc = anvil.parse('#!aml\nfoo := 1;');
doc.get('foo').asInt(); // 1
In a browser, without a bundler:
<script src="/vendor/anvil/anvil.browser.js"></script>
<script>
// anvil.wasm is fetched from next to the script; say where it is otherwise:
anvl.ready({ wasmUrl: '/assets/anvil.wasm' }).then(() => {
anvl.parse('#!aml\nfoo := 1;').get('foo').asInt(); // 1
});
</script>
Node.js* (Unsupported) — N-API
ready() needed). Linux x86_64 (glibc) only today; not published to a package
registry, so install it from the tarball and build other platforms from source.
const anvil = require('anvil-node');
const doc = anvil.parse('#!aml\nfoo := 1;');
doc.get('foo').asInt(); // 1
Verify any download with SHA256SUMS
(sha256sum -c SHA256SUMS in the folder holding the files). SHA256SUMS
lists every release, current first; SHA256SUMS-v0.14.1-rc
lists only v0.14.1-rc (SHA256SUMS-<version> lists one release). The C library and anvil.js
downloads report the version 0.14.1-rc+585, and so do the .NET and Python downloads. The native
downloads (C library, .NET and Python) are Linux x86_64 only; anvil.js runs wherever JavaScript does.
Licence. Free for personal and educational use; free for commercial use up to
3 developer seats; no redistribution. The terms are in progress and not final; every download
includes a LICENSE.txt.
Previous releases: v0.14.0-rc — C library, anvil.js (no .NET or Python download; they stayed at v0.13.1-rc) (SHA256SUMS-v0.14.0-rc); v0.13.1-rc — C library, anvil.js, .NET, Python (SHA256SUMS-v0.13.1-rc); v0.13.0-rc — C library, anvil.js, .NET, Python (SHA256SUMS-v0.13.0-rc); v0.12.1-rc — C library, anvil.js, .NET, Python (SHA256SUMS-v0.12.1-rc); v0.12.0-rc — C library, anvil.js, .NET, Python (SHA256SUMS-v0.12.0-rc); v0.11.0-rc — C library, WebAssembly* (Unsupported), Node.js* (Unsupported), .NET, Python (SHA256SUMS-v0.11.0-rc); v0.10.0-rc — C library, WebAssembly* (Unsupported), Node.js* (Unsupported), .NET, Python (SHA256SUMS-v0.10.0-rc).
* Unsupported: frozen at v0.11.0-rc and no longer updated; replaced by anvil.js. The v0.11.0-rc downloads stay available.
Full usage guide for every binding is in Docs → Bindings; what changed in this release is in the Changelog. This is release-candidate software — the format and API are stable enough to build against, but expect the surface to keep moving before a 1.0 release.