FastScript — scripts that compile¶
FastScript is an optimized Skript alternative for Paper 1.21.8+
and Leaf servers. Scripts are written in a small Skript-like DSL and
JIT-compiled to JVM bytecode (via ASM) on load — one Java class per script.
After that, events are handled by plain compiled code, not an interpreter:
a ready MethodHandle is invoked with no name lookups, no reflection,
and no boxing where the type could be proven statically.
How it works (in short)¶
- Parsing — the
Lexerturns text into tokens (with syntheticINDENT/DEDENT), theParserbuilds an AST. - Type inference —
Compiler.kindOffinds the kind of every expression.number+numberbecomes primitiveDADD/DCMPLinstructions, everything dynamic goes toValues.*helpers. - Generation — one static method per trigger, command and function; loop state lives in JVM locals, not dictionaries.
- Loading —
ScriptLoaderdefines classes in a childClassLoader,ScriptEngineresolves eachMethodHandleonce and then just calls them.
See also: Quick start, Syntax, Operations and benchmarks.
Where is what in this wiki¶
| Section | Contents |
|---|---|
| Quick start | Build, install, first script, reload |
| Syntax and lexing | Indentation, comments, strings, numbers, variables |
| Triggers, commands, functions | on, command, function, events, where |
| Statements | if, loops, assignment, stop/return |
| Expressions and types | Precedence, ternary, calls, type inference |
| Built-in functions | Full catalog with signatures |
| Players and variables | Player properties, $/#, variables.yml |
| Script examples | Annotated ready-made scripts |
| Operations | Admin commands, plugin.yml, benchmarks, FAQ |
Requirements¶
- Server Paper 1.21.8+ / Leaf, compiled against
paper-api 1.21.8-R0.1-SNAPSHOT. - Java 21+ (
--release 21). No Gradle/Maven needed.