Weavly Compiler
Compiler for the Weavly dialogue scripting language. Parses .wvl files and compiles them to JSON for the Weavly Godot runtime.
Language documentation: https://weavly-lang.github.io/weavly-docs/
Install
Install uv, then:
uv tool install weavly
uv installs a suitable Python if needed and puts weavly on your PATH (run uv tool update-shell if it isn't). Upgrade with uv tool upgrade weavly.
With Python 3.11+ already installed, pipx install weavly works too.
Usage
weavly init my-project # creates my-project/src/nodes.wvl
cd my-project
weavly build # compiles src/**/*.wvl into build/
weavly build --pretty # same, with indented JSON
weavly --version # installed compiler version
weavly init without a name sets up src/ in the current directory.
The build writes:
build/<path>.wvl.jsonfor each source file, containing its nodes and asourcefield with the path relative tosrc/(for example"chapter1/intro.wvl"). Nodes, statements, match and random cases and option items carry the 1-basedlinethey start on, so runtime errors can point back to the.wvlsource.build/env.jsonwith every@envdeclaration in the project
Commands take comma-separated expressions as arguments and are written with them in args, for the game to evaluate when the command runs:
@play_sound "door", $volume * 0.5
{"type": "command", "line": 1, "id": "play_sound", "args": ["door", {"op": "*", "left": {"variable": "volume"}, "right": 0.5}]}
Arguments are checked like any other expression. Command names aren't declared, so the build doesn't check them or how many arguments they get.
Variables defined outside .wvl, as Godot resources or by game code, are declared with extern and a type, without a default, min or max. They're written to env.json with "extern": true and no value:
@env
score: number = 0
extern reputation: number
@endenv
Every variable a script uses must be declared, in expressions, as the target of @set, @increase, @decrease, @setflag and @clearflag, as a character line's $name, and as {$name} in line, option, hint and continue text. The build also checks types:
+ - * /, unary-and random weights need numbers;and,orandnotneed flags.- Comparisons need both sides of the same type.
- Conditions (
@if,@elif,@when, option, hint and case conditions) must be flags. @setmust match the variable's type,@increaseand@decreaseneed a number variable,@setflagand@clearflaga flag variable, and a character line's$namea string variable.visited()is a flag,visit_count()and the other built-in functions are numbers, and built-in function arguments are numbers.
Syntax errors, duplicate variable declarations, number declarations whose min, max or default don't fit together, duplicate node ids, unknown functions, function calls with the wrong number of arguments, @goto, visited() and visit_count() targets with no matching node, undeclared variables, and type errors fail the build with exit code 1. A failed build leaves the previous build/ untouched.
Development
git clone https://github.com/weavly-lang/weavly-compiler.git
cd weavly-compiler
uv sync --group dev
See CONTRIBUTING.md for the workflow and release steps.
License
Release files for weavly 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| weavly-0.3.0.tar.gz | 25.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| weavly-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 43.7 kB
Release files / weavly-0.3.0.tar.gz
| Download URL | weavly-0.3.0.tar.gz |
|---|---|
| Size | 25.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a493acda3cd900dc88571af1f85ee9e795559f2d3dd93ed7d7b1f95f62e8b0f4
|
|
BLAKE2b-256 checksum How to use checksums |
7183cce90584a5459307f4abc14a54e3eae38a1f1e0569fefd2172ca2d56d92f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.
Transparency logRelease files / weavly-0.3.0-py3-none-any.whl
| Download URL | weavly-0.3.0-py3-none-any.whl |
|---|---|
| Size | 18.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2a11507096adffc24eac3f8602622885edbf8a95c1629a110ebf610e67b9db05
|
|
BLAKE2b-256 checksum How to use checksums |
4e68d1e51e583f54d145571bc491ce1614a63226b9757e59759b4d9bd4ab5119
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.
Transparency log