1.12.0

Upcoming release

BoxLang 1.12.0 is an upcoming language-focused release. It adds modern destructuring patterns, literal and function-call spread syntax, and the new inclusive .. range operator. It also tightens parser behavior, improves compiler coverage, and expands runtime support across both BoxPilers.

πŸš€ Major Highlights

🧩 Struct and Array Destructuring

BoxLang now supports destructuring for both structs and arrays.

user = { name: "Luis", role: "admin", meta: { team: "core" } }
({ name, meta: { team } } = user)

numbers = [ 1, 2, 3, 4, 5 ]
[ first, ...middle, last ] = numbers

Highlights:

  • Struct destructuring with shorthand and explicit renaming

  • Array destructuring with positional bindings

  • Nested destructuring patterns

  • Default values

  • Rest capture

  • Scoped assignment targets when explicitly named

  • Middle-rest support for arrays

🌟 Spread Syntax

BoxLang now supports spread syntax in literals and function calls.

Highlights:

  • Function-call spread for arrays and structs

  • Array literal spread

  • Unordered and ordered struct literal spread

  • Multi-source merging with declaration-order precedence

  • Struct shorthand keys like { host, port }

πŸ”’ Inclusive Range Operator

BoxLang now supports the inclusive .. range operator.

This gives BoxLang a compact way to generate ascending or descending integer ranges.

✨ New Features

Destructuring declarations and assignments

Struct destructuring supports:

  • shorthand bindings

  • explicit renaming

  • nested patterns

  • missing-key defaults

  • rest capture for remaining keys

  • scoped targets in direct assignments

Array destructuring supports:

  • positional bindings

  • nested patterns

  • rest bindings

  • middle-rest extraction

  • predictable short-array behavior

  • defaults for missing or null values

Spread in function arguments

Function-call spread is supported in both BoxLang and CFML grammars.

Arrays expand as positional arguments. Structs expand as named arguments.

This works with:

  • built-in functions

  • member methods

  • closures

  • lambdas

  • returned function expressions

Literal spread and shorthand keys

Spread syntax is now supported in these literal forms:

  • Array literals like [ 1, ...values, 4 ]

  • Unordered struct literals like { ...defaults, debug: true }

  • Ordered struct literals like [ ...defaults, retries: 5 ]

Struct literals also support shorthand keys.

Ambiguous spread-only bracket literals

Spread-only bracket literals are resolved at runtime:

  • array sources resolve to arrays

  • struct sources resolve to ordered structs

  • mixed source types are rejected

circle-exclamation

πŸ› οΈ Improvements

Parser and compiler support

These features now flow through the full language stack:

  • Grammar updates

  • Parser control improvements

  • Clearer parse errors for unparenthesized struct destructuring assignments

  • AST coverage for destructuring, spread, and range behavior

  • Java boxpiler support

  • ASM boxpiler support

  • Pretty printing and visitor support for the new nodes

Runtime helpers

New runtime helpers back the feature set:

  • Object destructuring runtime support

  • Array destructuring runtime support

  • Literal spread utilities

  • Inclusive range operator runtime behavior

More stable test runs

Test execution now isolates user.home and HOME so local ~/.boxlang state does not affect results.

βœ… Compatibility Notes

  • Non-declaration struct destructuring assignments must be wrapped in parentheses.

  • Struct shorthand requires valid identifier keys.

  • Quoted, spaced, or numeric keys must use explicit renaming.

  • Scoped destructuring targets are not allowed in var, final, or static destructuring declarations.

  • Struct literal merge precedence is last write wins.

  • Spreading arrays into structs uses 1-based numeric keys.

πŸ“š Documentation

See the new language pages for full syntax and examples:

Last updated

Was this helpful?