A scripting language for games, servers and agents.
SCUA is a general-purpose language. Use it where you would reach for Python or Lua: tools, data jobs, services, the logic inside a game. It is strongest in games, the servers behind games and apps, and AI agents, because saving a running program, sandboxing code and a JIT are part of the language.
No public download yet. The playground runs the real compiler, and the sample on this page runs when you press Run.
-- Check data where it arrives, then trust it everywhere else.
record Item { id: string, qty: int where qty > 0 }
record Player {
name: string,
hp: int where hp >= 0,
inventory: { Item },
}
let incoming: any = { name = "Ana", hp = 80,
inventory = [{ id = "bow", qty = 1 }] }
let ana = parse(incoming, Player)
print(`recruited {ana.name} with {ana.hp} hp`)
let bad: any = { name = "Bo", hp = 70,
inventory = [{ id = "axe", qty = 0 }] }
try parse(bad, Player) rescue e print(e.message) end
$ scua boundary.scua
recruited Ana with 80 hp
parse(bad, Player): bad.inventory[0].qty violates Item's where rule (got 0)Where it fits
Four kinds of work it is good at
The syntax will feel familiar in a few minutes. Pick the job closest to yours.
Games and multiplayer
Script game logic inside your engine, and run the same language on the server.
- Each player is sent only the fields they may see
- A live session can move to another server
- Vectors, geometry, saves and data packs built in
Backend servers
Write the service behind a game or an app without a framework or an event loop.
- An HTTP server in the language, in Bun's speed class
- Actors that run on several cores, with no locks
- Idle sessions sleep in storage and hold no memory
AI agents
Give a model tools it can call, and run what it writes without handing it your machine.
- Tool schemas come from one typed record
- Model-written code runs with no access and a budget
- A waiting conversation is one stored object
Scripts and tools
The everyday jobs you would give Python or Lua: a command-line tool, a report, a data fix.
- Data tables you filter, group and join, read from CSV
- Exact decimal money, and arguments checked for you
- One binary to run it, one file to ship it
State that saves and moves
Save or move a running session as bytes
Each partition, which is SCUA's kind of actor, keeps its state in one block of memory that does not care where it sits. So a host can write that block to a file, or send it to another machine, and the session carries on from where it was. You do not write a save function or a load function, and nothing is converted to JSON on the way.
That one property is behind moving a player to a less busy server, sleeping an agent while it waits for a slow model, and resuming a job after a restart.
See how state moves →Safe to run code you did not write
A script touches only what it was given
A SCUA script starts with no access to your files, the network, the environment or other programs. The host grants each one, and can grant a slice: one folder, one host name, one port. A script that asks for anything else is told which grant is missing.
Code from a player, a plugin author or a language model can also be compiled at run time into a sandbox that holds nothing at all, with a limit on how much work and memory it may use.
See how grants work →Fast without a flag
Keeps pace with LuaJIT, with no flag to set
Hot loops compile to native code while the program runs. The JIT is on by default on x86-64 and ARM64, so there is nothing to switch on. With it off, the interpreter runs at about the speed of Lua 5.4's. With it on, SCUA trades places with LuaJIT from workload to workload, and both are far ahead of Python.
Where there is no JIT, as on Windows on ARM, in WebAssembly, or on a platform that does not allow code to be generated at run time, the same program runs on the interpreter.
More on speed →A server in the language
Serve HTTP from a script, at Bun's pace
http.serve takes a handler and runs it for each request. Every request gets its
own isolated state, so handlers can wait on a database or another service without blocking
each other, and there is no async or await to thread through your code.
On the same machine, a handler that does real work answered more requests a second than Bun or uWebSockets.js, on one thread and on four: 146,210 a second across four threads, against 113,396 and 106,494. On a fixed plaintext reply SCUA was ahead of Bun and behind uWebSockets.js at both sizes.
SCUA for servers →The full table and the handler are in the 0.35.0 release post.
Also in the language
Built in, where you would expect a library
Types when you want them
Write it untyped, or add annotations and get the mistake at compile time. Records, enums that carry data, and a match that must cover every case.
Data checked at the door
parse(value, Type) checks a whole tree of data once, and a contract reports every rule that failed, not only the first.
Exact money and huge numbers
A built-in decimal keeps prices exact to the penny, and big numbers keep counting past 64 bits.
Data tables
A frame is a table you filter, group, total and join with method calls, and read from CSV.
Many things at once
wait_all and map_all run a batch of ordinary function calls and hand the results back in order. Under --io=async their waits overlap.
Editor, debugger, tests
A language server and a step debugger for VS Code and Zed, scua test, and a playground that runs the real compiler.
Native libraries
An experimental FFI calls C libraries directly. We use it for the SQLite package: rows come back as tables, and every failure is a value.
Native libraries and FFI →64 first-party packages
PostgreSQL, Redis, JWT, OAuth, an LLM client, charts, PDF, Excel, pathfinding, behaviour trees and more.
See the packages →Where it runs
Runs on macOS, Linux, Windows and WebAssembly
SCUA is one binary on each desktop system. It also builds to WebAssembly, and it embeds in a C or C++ program through one header. iOS and Android are planned.
Try it now
The compiler runs in your browser
The playground runs the real compiler, built to WebAssembly. Your code stays on the page.
Request early access
SCUA is in early access. Ask for it and we will email you when yours is ready.
Early access is the binaries for macOS, Linux and Windows, a WebAssembly build, the language server, the debugger, the manual and the examples. What you get →