Better than JSON. Cheaper than YAML. Built for AI and humans.
What does this extension do?This extension adds full support for
See it in actionWriting data — clean and simpleJust key, space, value. No quotes, no commas, no braces:
|
| Feature | JSON | YAML | SYNX |
|---|---|---|---|
| Quotes needed | Yes | Sometimes | No |
| Commas / braces | Yes | No | No |
| Built-in logic | No | No | Yes (!active) |
| AI token usage | ~100% | ~75% | ~40% |
| Learning curve | Medium | High | Low |
!active Mode
!active
port:env:default:8080 PORT
boss_hp:calc base_hp * 5
greeting:random
- Welcome!
- Let's go!
- Game on!
loot:random 70 20 10
- common
- rare
- legendary
No extra libraries. No custom code. The format handles it.
Performance
How do data formats compare in real-world usage?
| Metric | JSON | YAML | TOML | SYNX |
|---|---|---|---|---|
| Parse speed (10KB config) | ~0.5 ms | ~20 ms | ~5 ms | ~1.5 ms |
| File size (same data) | 100% | ~75% | ~80% | ~40% |
| AI tokens (same data) | 100% | ~75% | ~80% | ~40% |
| Built-in logic | No | No | No | Yes |
| Learning curve | Medium | High | Medium | Low |
- JSON — fastest parsing (native V8/CPython), but heaviest syntax
- YAML — human-friendly, but complex rules and slowest parsing
- TOML — clean for flat configs, but verbose with nesting
- SYNX — near-JSON speed, 60% fewer tokens, built-in logic with
!active
Packages
| Package | Install |
|---|---|
| JavaScript / TypeScript | npm install @aperturesyndicate/synx |
| Python | pip install synx-format |
| VS Code | You're looking at it! |
📐 Grammar — Syntax Rules & Reference
Basic Syntax (always works)
Key–Value Pairs
Everything after the first space is the value. No quotes.
name John
age 25
phrase I love programming and coffee!
Nesting
2 spaces of indent = nested object.
server
host 0.0.0.0
port 8080
ssl
enabled true
cert /etc/ssl/cert.pem
Lists
inventory
- Sword
- Shield
- Health Potion
Lists of Objects
garage
- make BMW
color black
year 2023
- make Audi
color white
year 2021
Multiline Text
description |
This is a long description
that spans multiple lines.
Comments
# Python/YAML style comment
// JS/C++ style comment
name John # Inline comment
Type Casting
Force a specific type for any value with (type) right after the key name:
zip_code(string) 90210
id(int) 007
ratio(float) 3.0
enabled(bool) true
Without casting, 90210 would auto-detect as a number. With (string) it stays a string.
Without casting, 007 would become 7. With (int) it keeps the numeric parse but stays explicit.
Supported types: (int), (float), (bool), (string)
The (type) annotation is highlighted in the editor — key name, type cast, and value each get a distinct color so you can instantly see what's what.
!active Functions
Functions only work when
!activeis the first line of the file.
:random — Random Selection
!active
greeting:random
- Hello!
- Welcome!
- Hey there!
:random — Weighted
!active
loot:random 70 20 10
- common
- rare
- legendary
:calc — Arithmetic
!active
price 100
tax:calc price * 0.2
total:calc price + tax
Operations: +, -, *, /, %, (, ). No eval() — safe.
:env — Environment Variables
!active
port:env PORT
port:env:default:8080 PORT
:alias — Key Reference
!active
admin_email alex@example.com
support_email:alias admin_email
:secret — Hidden Value
!active
api_key:secret sk-1234567890
Shows [SECRET] in logs/serialization, real value in code.
:unique — Deduplicate List
!active
tags:unique
- action
- rpg
- action
Result: ["action", "rpg"]
:include — Include File
!active
database:include ./db.synx
:default — Fallback Value
!active
theme:default dark
:geo — Value by Region
!active
currency:geo
- US USD
- EU EUR
- GB GBP
:template — String Interpolation
!active
first_name John
last_name Doe
greeting:template Hello, {first_name} {last_name}!
Supports dot-path references: {server.host}
:split — Split String into Array
!active
colors:split red, green, blue
words:split:space hello world foo
Default delimiter: comma. Keywords: space, pipe, dash, dot, semi, tab
:join — Join Array into String
!active
tags:join
- action
- rpg
- adventure
Default delimiter: comma. Same keywords as :split
!active Constraints
[min:N] / [max:N] — Min/Max
!active
app_name[min:3, max:30] TotalWario
volume[min:1, max:100] 75
[required] — Required Field
!active
api_key[required]:env API_KEY
[type:X] — Type Enforcement
!active
max_players[type:int] 16
[enum:a|b|c] — Allowed Values
!active
theme[enum:light|dark|auto] dark
[pattern:regex] — Regex Validation
!active
country_code[pattern:^[A-Z]{2}$] US
[readonly] — Read Only
!active
version[readonly] 2.0.0
Combining Constraints
!active
password[required, min:8, max:64, type:string] MyP@ssw0rd
Functions Summary
| Function | Description | Example |
|---|---|---|
:random |
Random item | msg:random |
:random N N N |
Weighted random | loot:random 70 20 10 |
:calc |
Arithmetic | total:calc price * 1.2 |
:env |
Env variable | port:env PORT |
:alias |
Key reference | copy:alias original |
:secret |
Hidden value | key:secret abc123 |
:default |
Default value | theme:default dark |
:unique |
Deduplicate | tags:unique |
:include |
Include file | db:include ./db.synx |
:geo |
Value by region | currency:geo |
:template |
String interpolation | msg:template Hello, {name}! |
:split |
Split string → array | colors:split red, green, blue |
:join |
Join array → string | tags:join |
Constraints Summary
| Constraint | Description | Syntax |
|---|---|---|
min |
Min length/value | [min:3] |
max |
Max length/value | [max:100] |
type |
Data type | [type:int] |
required |
Required | [required] |
pattern |
Regex | [pattern:^\d+$] |
enum |
Allowed values | [enum:a\|b\|c] |
readonly |
Read only | [readonly] |
Quick Reference
KEY VALUE → simple pair
key → empty object (group)
nested_key value → nesting (2 spaces)
key | → multiline text block
list → list
- item
# comment → comment
// comment → comment
─── Only with !active ──────────────────────
key:random → random item
key:random 70 20 10 → weighted random
key:calc A * B → arithmetic
key:env VAR → env variable
key:env:default:X VAR → env + fallback
key:alias other_key → key reference
key:secret value → hidden value
key:unique → deduplicate list
key:include ./file.synx → include file
key:template Hello, {name}! → string interpolation
key:split red, green, blue → split string → array
key:join → join array → string
key[min:N, max:N] → min/max
key[type:int] → type
key[required] → required
key[enum:a|b|c] → allowed values
key[pattern:regex] → regex
key[readonly] → read only
Extension Commands
| Command | Description |
|---|---|
| SYNX: Convert to JSON | Converts the current .synx file to a .json file |
| SYNX: Freeze | Resolves all !active functions and saves a static .synx |
| SYNX: Preview | Opens a side panel with the parsed JSON output |
All commands are available via the Command Palette (Ctrl+Shift+P) and right-click context menus on .synx files.
Full Specification
For the complete format reference, see:
Links
Made by APERTURESyndicate Production
MIT — © APERTURESyndicate