Skip to content

Changelog

v0.0.5.2 — Variable Arithmetic Fix (2025-12-02)

Section titled “v0.0.5.2 — Variable Arithmetic Fix (2025-12-02)”

Fixed a critical bug where arithmetic operations using variables would fail with “unsupported binary operation” errors. Previously, assignment statements (price = 100) were not stored in the symbol table, causing subsequent references to be treated as undefined identifiers instead of their numeric values.

Before (broken):

price = 100
tax = 15
total = price + tax // ❌ Error: unsupported binary operation

After (fixed):

price = 100
tax = 15
total = price + tax // ✅ Works! total = 115
discount = 20
final = total - discount // ✅ final = 95

Technical Details:

  • Modified Transpiler.Transpile() to store assignment values in both the symbol table and output
  • File: internal/transpiler/transpiler.go (line 75)
  • Now assignments can be referenced in subsequent expressions

Examples:

// Chained calculations
quantity = 5
itemPrice = 10
subtotal = quantity * itemPrice // 50
// Mixed operations
base = 100
withTax = base + 15 // 115
withDiscount = withTax - 10 // 105
doubled = withDiscount * 2 // 210

Added compilation time measurement to both CLI and playground for performance visibility.

CLI:

Terminal window
$ jsson -i config.jsson > output.json
Compiled in 552.6µs
  • Auto-formats time units: µs, ms, or s
  • Printed to stderr (doesn’t interfere with output redirection)
  • Helps identify performance bottlenecks

Playground:

  • Real-time performance feedback in output footer
  • Auto-formatted display (µs/ms/s)
  • Green checkmark indicator

Added streaming infrastructure for efficient handling of large data volumes.

CLI Flags:

Terminal window
# Enable streaming mode
jsson -i large-data.jsson --stream
# Auto-enable for ranges > N items (default: 10,000)
jsson -i data.jsson --stream-threshold 5000

Features:

  • Memory reduction: ~500MB → < 50MB for 100k items
  • Lazy evaluation with RangeIterator
  • Automatic threshold detection
  • Added 40+ edge case tests to improve robustness
  • Created comprehensive test suite for variable arithmetic
  • Updated WASM binary with all fixes

v0.0.5.1 — Parser Bug Fixes (2025-11-29)

Section titled “v0.0.5.1 — Parser Bug Fixes (2025-11-29)”

Fixed parsing of chained ternary expressions. Previously, expressions like 5 > 3 ? 10 > 8 ? "yes" : "maybe" : "no" would fail with a parser error. Now they work correctly with proper right-associativity.

Technical Details:

  • Changed precedence to TERNARY - 1 for both consequence and alternative branches in parseConditionalExpression
  • File: internal/parser/parser.go

Fixed support for ranges starting with negative numbers. Previously, -5..5 would fail. Now it works correctly.

Technical Details:

  • Modified parsePrefixExpression to create negative IntegerLiteral and FloatLiteral directly instead of BinaryExpression(0 - value)
  • File: internal/parser/parser.go

Fixed parsing of map expressions applied to ranges. Previously, 1..3 map (x) = x * 2 required parentheses: (1..3) map (x) = x * 2. Now it works without parentheses.

Technical Details:

  • Reorganized operator precedence: CALL < RANGE < MAP < INDEX
  • Changed parseRangeExpression to use MAP precedence for end value parsing
  • File: internal/parser/parser.go

Note: Arithmetic in range end values requires parentheses for clarity: i..(i+2) ✅, not i..i+2 ❌ (ambiguous)

Fixed support for array templates with map clauses when used as object properties. Previously, this would fail:

templates {
withMap [
template { id, value }
map (item) = { id = item.id * 10 }
1, "test"
]
}

Technical Details:

  • Changed parseObjectLiteral to call parseArrayTemplate() directly instead of parseArrayLiteral()
  • File: internal/parser/parser.go

Fixed error messages to show the correct line number instead of always showing line:1:1. Now errors accurately point to the exact line and column where the problem occurred.

Technical Details:

  • Added missing AST node types to error reporting switch cases: MapExpression, ConditionalExpression, InterpolatedString, BooleanLiteral
  • File: internal/transpiler/transpiler.go
// Nested ternaries
status = age > 18 ? score > 80 ? "excellent" : "good" : "minor"
// Negative ranges
temperatures = -10..10
// Range-map without parentheses
doubled = 1..5 map (x) = x * 2
// Templates with map in objects
config {
users [
template { id, name }
map (u) = { id = u.id * 100, name = u.name }
1, "Alice"
2, "Bob"
]
}

v0.0.5 — Nested Logic Power-Up (2025-11-28)

Section titled “v0.0.5 — Nested Logic Power-Up (2025-11-28)”

JSSON now allows map() transformations inside other map() transformations. This enables multi-level pipelines, matrix-like generation, combinatorial data creation, and far more expressive logic.

Example:

nested = (0..2 map (g) = (5..6 map (x) = g + x))

Nested arrays now work everywhere:

  • Inside templates
  • Inside map clauses
  • As direct literal values
  • As intermediate evaluated expressions

JSSON automatically expands, flattens, or structures arrays as needed without losing context.

Ranges (0..N) now work in all places where expressions are allowed:

  • Inside arrays
  • Inside map arguments
  • Inside templates
  • Nested within other ranges
  • Used as part of deeper transformations

This makes large-scale data generation extremely simple:

0..9999

Declare variables for reuse and cleaner configuration. Variables are scoped and support shadowing.

host := "localhost"
port := 8080
url = host + ":" + port

Arithmetic Improvements (Division & Modulo) ➗

Section titled “Arithmetic Improvements (Division & Modulo) ➗”

Arithmetic is now fully stable for / and %.

Modulo (%) and division (/) now work inside map logic, expressions, and nested operations.

Example:

hash = "uid-" + (u.id * 91 % 17)

Invalid operations (like applying modulo directly to an entire range literal) now produce clear semantic errors instead of causing crashes.

  • Better handling of RangeResult values during deep transformations
  • More reliable evaluation order for nested arrays and nested maps
  • Improved safety checks to prevent unexpected binary operations on non-scalar values
  • Cleaner error messages that explain exactly where an invalid operation was attempted
  • Internal prep for future collection operators and functional features

JSSON v0.0.5 turns the language into a true data-generation powerhouse:

  • Unlimited nesting
  • Unlimited ranges
  • Stable math
  • Cleaner semantics
  • Smarter expansion rules

Large-scale data creation is now faster, safer, and easier than ever.


v0.0.4 — Universal Meta-Format (2025-11-26)

Section titled “v0.0.4 — Universal Meta-Format (2025-11-26)”

JSSON is no longer just for JSON. You can now transpile your JSSON files into 4 different formats:

  • JSON (Default)
  • YAML (-f yaml)
  • TOML (-f toml)
  • TypeScript (-f typescript)

When transpiling to TypeScript, JSSON automatically generates:

  • as const assertions for immutability
  • Exported type definitions (export type Config = typeof config)
  • Fully typed objects ready for use in your frontend or backend
  • Added -f / --format flag to specify output format.
  • Improved error messages for invalid formats.
  • New Playground: Now supports tabs for JSON, YAML, TOML, and TypeScript outputs.
  • Privacy & Terms: Added legal pages to ensure transparency.
  • Landing Page: Updated to reflect JSSON’s new universal capabilities.

  • Fixed support negative numbers in expressions.
  • Added unary minus operator support for negative numbers.

v0.0.3 — Arrays in Objects & Real-World Examples (2025-11-25)

Section titled “v0.0.3 — Arrays in Objects & Real-World Examples (2025-11-25)”

You can now use arrays directly as object property values!

config {
methods = ["GET", "POST", "PUT", "DELETE"]
ports = [8080, 8081, 8082]
tags = ["api", "v1", "production"]
}

This unlocks powerful new use cases:

  • API gateway configurations with allowed methods
  • Kubernetes configs with container ports
  • Feature flags with target user segments
  • And much more!

Map transformations can now include array properties:

routes [
template { service }
map (r) = {
service = r.service
allowMethods = ["GET", "POST", "PUT"]
allowHeaders = ["Content-Type", "Authorization"]
}
"auth"
"payment"
]

Added 6 comprehensive real-world examples demonstrating JSSON’s power:

  1. Geographic Data — Generate millions of coordinate records
  2. Kubernetes Configuration — Multi-environment deployments
  3. API Gateway — Microservices routing with rate limiting
  4. i18n Translations — Multi-language translation management
  5. Feature Flags — Environment-specific configuration
  6. Database Seeding — Relational data with foreign keys

Each example includes:

  • Complete JSSON code
  • JSON output samples
  • Explanation of techniques used
  • When to use the pattern
  • Enhanced parseObjectLiteral to support array literals as property values
  • Better error messages for syntax issues
  • Improved handling of nested structures
  • New “Real-World Use Cases” section in docs
  • Overview page explaining production scenarios
  • Individual pages for each example with detailed explanations
  • Updated SEO keywords for better discoverability
  • Fixed parsing of complex nested objects with arrays
  • Improved transpiler handling of mixed data structures

JSSON v0.0.3 can now handle even more complex scenarios:

  • ~500 lines of JSSON → 600+ JSON records
  • Ratios up to 50,000:1 for large-scale data generation

v0.0.2 — Arithmetic & Conditional Logic (2025-11-24)

Section titled “v0.0.2 — Arithmetic & Conditional Logic (2025-11-24)”
  • Arithmetic operators: +, -, *, /, %
  • Comparison operators: ==, !=, >, <, >=, <=
  • Ternary operator: condition ? true : false
  • Map transformations with conditional logic
  • String concatenation in expressions
users [
template { name, age }
map (u) = {
name = u.name
age = u.age
isAdult = u.age >= 18
category = u.age >= 18 ? "adult" : "minor"
}
"João", 25
"Maria", 16
]

  • Core parser for JSSON syntax
  • Template arrays for structured data
  • Range expressions (1..100)
  • Include statements for file composition
  • CLI tool for transpilation
  • Basic data types: strings, numbers, booleans, objects, arrays
users [
template { name, age }
"João", 19
"Maria", 25
]
ports = 8080..8085

Future versions may include:

  • Functions/macros
  • Array methods (filter, map, reduce)
  • More advanced control flow

Stay tuned!