Language reference

On this page

Use these pages to explore language features and common patterns. Start with the course for a guided introduction, or browse the function reference for built-in functions.

PageCovers
OperatorsArithmetic, comparison, bitwise, castAs, instanceOf, elvis and safe navigation
Destructuring, spread and ranges{ a, b } = s, ..., 1..5
Setsset{}, setNew, algebra operators, member functions
Classesinit, inheritance, interfaces and properties
Scopesvariables, arguments, closures, web scopes
Error handlingtry, typed catch, finally, throw and rethrow
Async and futuresrunAsync, then, errors, browser behavior
Templates (.bxm)Markup, expressions and script blocks
Modules--module, ModuleConfig.bx, discovery
Java interopThe JNI bridge and its limits
Queries and dataqueryNew, datasources, query of queries, build features

File types

ExtensionUse
.bxsScript. Run with matchbox file.bxs.
.bxClass file, resolved by new and import. Also accepted as a module BIF file.
.bxmTemplate. Run with matchbox file.bxm or serve with --serve.
.bxbCompiled bytecode, produced by matchbox --build.

.cfm, .cfc and .cfs files are not supported. matchbox page.cfm fails with a parse error.

For an overview of runtime and target differences, see BoxLang compatibility.

Edit this page Download Markdown Last updated Oct 27, 2026, 1:45:34 PM Report an issue