SHON (Structured Human-Optimized Notation) is a data serialization format designed for readability, schema support, and practical use in modern systems. Version 0.6 introduces advanced types and syntax improvements.
- Single-line:
// comment here
- Multi-line:
/* this is a multi-line comment */
@users {
...
}
key: value
SHON Syntax | Description |
---|---|
"string" |
String |
42 , true , false |
Number and boolean |
$decimal("12.34") |
Decimal with precision |
$timestamp("2024-01-01T00:00:00Z") |
ISO 8601 timestamp |
$tuple(1, "a", true) |
Anonymous tuple |
Vec3(1.0, 2.0, 3.0) |
Named tuple |
[1, 2, 3] |
Array |
{ key: value } |
Map or Struct (based on schema) |
&ref.to.path |
Reference |
numbers: [1, 2, 3]
translations: {
en: "Hello",
es: "Hola"
}
Structs look like maps but are validated against a schema with fixed fields.
user: {
name: "Sean",
active: true
}
$tuple(1, "a", true)
Vec3(1.0, 2.0, 3.0) // Named tuple
manager: &people.sean
created: $timestamp("2025-03-22T14:30:00Z")
price: $decimal("19.95")
@invoice {
id: "INV001",
total: $decimal("1042.75"),
created: $timestamp("2025-03-22T10:00:00Z"),
items: [
$tuple("Widget", 3, $decimal("9.99"))
],
paid: false
}