A small, strict language for config and messages.
ANVL — Attributed · Node · Variadic · Language
ANVL is a text format with two dialects — AML for
declarative modelling and configuration, and AMP for
restricted, scalar-only messaging payloads. This is the JavaScript
parser and serializer: pure JS, no runtime dependencies, and a
real, working parser you can drop into a browser with one
<script> tag.
Why not just JSON?
JSON is a fine wire format. It's a rough config format — no comments, no way to reference a value you already defined, no restricted subset for contexts where a payload shouldn't be able to grow arbitrary structure. ANVL exists for the cases where those gaps actually cost you something.
| JSON | ANVL | |
|---|---|---|
| Comments | Not allowed | // and /* */ |
| Reference a value you already defined | Copy-paste, or a non-standard $ref convention |
Native $identifier, resolved once at parse time |
| Extend or override a template | Not supported | Single inheritance — Child : Base := {...} |
| A restricted subset for untrusted-ish payloads | None — any valid JSON is valid JSON | AMP dialect: scalars and scalar collections only, rejected otherwise at parse time |
| Metadata attached to a field | Invent your own convention | Native @[key=value] attributes |
| Bare identifiers as values | Always quoted strings | Unquoted wherever unambiguous |
None of this is exotic on its own — TOML and YAML each solve pieces of it too. ANVL's bet is doing all of it under one strict, unambiguous grammar, plus a second, deliberately restricted dialect for when you want structure but not arbitrary structure.
Why ANVL
Strict by design
Required statement terminators, no ambiguous comment characters, no silent coercions. Mistakes fail to parse instead of quietly meaning the wrong thing.
Two dialects, one grammar core
AML allows full nesting — objects, arrays, tuples, inheritance, one-time $ references. AMP
strips it down to scalars and scalar collections only, enforced at parse time, not by convention.
Round-trip capable
Parse to a read-only AnvilNode tree, then write it back out — pretty-printed or minified — and
re-parse to the same structure.
A look at AML
#!aml
server @[env = production] := {
host := localhost;
port := 8080;
tags := [edge, cache];
};
// variables can be defined and referenced
var_ref := 42;
derived_var := $var_ref;
Try it now
The playground runs the actual bundle in your browser — paste ANVL source, parse it, and see the structure and the re-serialized output, live.