Syntax Guide
Learn the complete Tauq syntax in 5 minutes. If you know JSON, you already know 80% of Tauq.
The Core Idea
Tauq is JSON without the noise. No quotes around keys, no commas between values, no colons after keys. Just key value pairs separated by spaces or newlines.
{"name": "Alice", "age": 30, "active": true} name Alice age 30 active true On This Page
Values & Types
Tauq automatically infers types from how you write values. No type annotations needed.
Strings
Barewords - no quotes needed for simple strings:
name Alice
status active
role admin Quoted - use quotes for spaces or special chars:
greeting "Hello, World!"
path "/usr/local/bin"
email "alice@example.com" Numbers
Integers and floats work exactly like JSON:
age 28
price 99.99
count 1000000
temperature -40.5
scientific 6.022e23 Supports negative numbers, decimals, and scientific notation.
Booleans
active true
deleted false
enabled true Null
metadata null
parent null
optional_field null Type Inference at a Glance
| You Write | Tauq Type | JSON Output |
|---|---|---|
42 | Integer | 42 |
3.14 | Float | 3.14 |
true / false | Boolean | true / false |
null | Null | null |
hello | String (bareword) | "hello" |
"hello world" | String (quoted) | "hello world" |
Objects
Objects use curly braces { key value }. Key-value pairs are separated by spaces or newlines.
Tauq
database {
host localhost
port 5432
name myapp_db
credentials {
username admin
password secret123
}
} Equivalent JSON
{
"database": {
"host": "localhost",
"port": 5432,
"name": "myapp_db",
"credentials": {
"username": "admin",
"password": "secret123"
}
}
} Key Differences from JSON
- ✓ No colons after keys:
host localhostinstead of"host": "localhost" - ✓ No commas between values: values are separated by spaces or newlines
- ✓ No quotes around keys:
hostinstead of"host" - ✓ Bareword values:
localhostinstead of"localhost"
Arrays
Arrays use square brackets [ ] with space-separated values. Simple and clean.
Simple Arrays
# Numbers
scores [95 87 92 88 91]
# Strings (barewords)
tags [frontend backend devops]
# Mixed types
mixed [42 "hello" true null 3.14] Nested Collections
Arrays and objects can be nested arbitrarily:
users [
{ id 1 name Alice roles [admin user] }
{ id 2 name Bob roles [user] }
]
matrix [
[1 2 3]
[4 5 6]
[7 8 9]
] Schemas
The Power FeatureSchemas eliminate repetitive keys by defining field names once, then writing only values. This is where Tauq really shines for tabular data.
The Problem Schemas Solve
[
{"id": 1, "name": "Alice", "email": "alice@example.com", "role": "admin"},
{"id": 2, "name": "Bob", "email": "bob@example.com", "role": "user"},
{"id": 3, "name": "Carol", "email": "carol@example.com", "role": "user"}
] !def User id name email role
1 Alice alice@example.com admin
2 Bob bob@example.com user
3 Carol carol@example.com user How Schemas Work
Define a schema with !def TypeName field1 field2 field3
This declares the field names in order
Write records as space-separated values
Each line after !def is a new record with values in schema order
Reuse schemas inside arrays with !use TypeName
Apply a previously defined schema in nested contexts
Schemas in Nested Structures
Use --- to separate schema definitions from your data structure, then apply schemas with !use:
!def Product sku name price
!def OrderItem product_sku quantity
---
order {
id "ORD-2024-001"
customer {
name "Jane Smith"
email jane@example.com
}
items [
!use OrderItem
"LAPTOP-15" 1
"MOUSE-BT" 2
]
products [
!use Product
"LAPTOP-15" "ThinkPad X1" 1299.99
"MOUSE-BT" "Wireless Mouse" 29.99
]
total 1359.97
} Pro tip: The --- separator clears the implicit schema scope. After it, you can write objects and arrays while still referencing schemas inside arrays with !use.
Advanced Features
Comments
Use # for comments. Unlike JSON, Tauq supports inline comments:
# Database configuration
host localhost # Development server
port 5432 # Default Postgres port
max_connections 100 Multiline Strings
Use triple quotes for multiline content:
description """
This is a multiline string.
It preserves newlines and formatting.
Great for SQL, markdown, or templates.
""" Escape Sequences
Standard escapes work in quoted strings:
newline "line1\nline2"
tab "col1\tcol2"
quote "She said \"Hello\"" File Imports
Split configs across files:
# main.tqn
!import ./database.tqn
!import ./logging.tqn
app_name "MyService"
environment production Quick Reference
Values
42Integer3.14Floattrue/falseBooleannullNullhelloBareword string"Hello World"Quoted string"""multi"""Multiline string
Collections
[1 2 3]Array{ key value }Object{ outer { inner value } }Nested
Directives
!def Type f1 f2Define schema!use TypeUse schema---Clear scope!import ./file.tqnImport file# commentComment
Ready to Try It?
The best way to learn is by doing. Jump into the playground and experiment with Tauq syntax interactively.