boxlang-language-fundamentalslisted
Install: claude install-skill ortus-boxlang/skills
# BoxLang Language Fundamentals
## Overview
BoxLang is a modern, dynamic JVM language (JRE 21+) influenced by Java, CFML, Python,
Ruby, Go, and PHP. It compiles to Java bytecode and provides complete Java
interoperability with a more expressive, concise syntax.
## File Types
| Extension | Purpose |
|-----------|---------|
| `.bx` | Class files (components, services, models) |
| `.bxs` | Script files (standalone scripts, CLIs) |
| `.bxm` | Markup/template files (HTML output, views) |
## Variables and Scopes
BoxLang uses dynamic typing — types are inferred at runtime. Explicit type
annotations are optional but supported.
```boxlang
// Variable declaration (var keyword in functions)
var name = "BoxLang"
var count = 42
var price = 9.99
var active = true
// Null
var nothing = null
```
### Scope Chain (resolution order in a function)
1. `local` — variables declared with `var` inside a function
2. `arguments` — function parameters
3. `variables` — component/class private scope
4. `this` — component/class public scope
5. Named scopes: `url`, `form`, `session`, `application`, `request`, `cgi`, `server`
```boxlang
// Explicit scope reference
variables.counter = 0
this.publicValue = "visible"
local.tempResult = compute()
```
## Operators
```boxlang
// Arithmetic
a + b a - b a * b a / b a % b a ^ b a \ b // integer divide
// Comparison
a == b a != b a > b a < b a >= b a <= b
a === b a !== b // strict (type + value)
// Logical
a && b a || b !a
a