nvsl

Small, safe game scripting language with parser, checker, compiler, and VM.
https://github.com/nvsl-lang/nvsl

To install, run:

haxelib install nvsl 0.4.0 

See using Haxelib in Haxelib documentation for more information.

README.md

NVSL

NVSL is a small, safe game scripting language.

It is designed for strict, sandboxed scripting in games, but it is not tied to one engine or genre. You can use it for story flow, events, state changes, gameplay scripting, or host-driven runtime commands.

The toolchain is written in Haxe, so it can be embedded anywhere Haxe targets run, including HashLink, C++, JS, and other Haxe runtime targets.

What Is Here

  • parser and lexer
  • type checker
  • project loader and linker
  • AST runtime
  • bytecode compiler
  • bytecode VM
  • benchmark harness
  • docs
  • samples

Repo Layout

Quick Start

See INSTALL.md for full install and run instructions across Linux, Windows, and macOS.

From source on Linux:

./install.sh

From a release bundle:

./nvsl run path/to/scripts --entry game.app.main

Current release bundles:

  • nvsl-linux-x64.tar.gz
  • nvsl-macos-x64.tar.gz
  • nvsl-windows-x64.zip

The packaged bundles include the local HashLink runtime, so users do not need to install hl separately for the shipped bundles.

Compile and run a source project in one command:

./nvsl run path/to/scripts --entry game.app.main

Compile a source project into bytecode:

./nvslc path/to/scripts bin/game.nvbc --entry game.app.main

Run compiled bytecode:

./nvslvm bin/game.nvbc

Run a specific entrypoint:

./nvslvm bin/game.nvbc game.app.main

The wrapper scripts auto-build nvslc and nvslvm if the local bin/ outputs are missing or stale.

If you want the raw underlying commands, they are still:

haxe build.nvslc.hxml
haxe build.nvslvm.hxml
hl bin/nvslc.hl path/to/scripts bin/game.nvbc --entry game.app.main
hl bin/nvslvm.hl bin/game.nvbc

Run the bundled samples:

./nvsl samples

Run the built-in benchmark from a source checkout:

./nvsl bench

Add To PATH

From the repo root, add the local command wrappers to your shell PATH:

export PATH="/absolute/path/to/nvsl:$PATH"

Example:

export PATH="$HOME/Desktop/nvsl:$PATH"

Then you can run:

nvsl run path/to/scripts --entry game.app.main
nvslc path/to/scripts bin/game.nvbc --entry game.app.main
nvslvm bin/game.nvbc

If you want this permanently, add the export PATH=... line to your shell profile such as ~/.bashrc or ~/.zshrc.

Cross-Platform Status

The language core is cross-platform.

  • NVSL, nvslc, and nvslvm are written in Haxe
  • the compiler/runtime can be built anywhere the Haxe target and host runtime are supported
  • the repo-level source convenience scripts are still Linux/Bash-first
  • packaged release bundles are prepared for Linux, Windows, and macOS

So the honest answer is:

  • language/toolchain architecture: cross-platform
  • source install helpers: primarily Linux-oriented
  • packaged bundles: cross-platform for the supported release targets

If you already have Haxe and HashLink on another platform, the raw build/run commands still work:

haxe build.nvslc.hxml
haxe build.nvslvm.hxml
hl bin/nvslc.hl path/to/scripts bin/game.nvbc --entry game.app.main
hl bin/nvslvm.hl bin/game.nvbc

Automation

This repo includes GitHub Actions for:

  • CI builds on pushes and pull requests
  • sample-suite validation
  • tagged releases that attach nvslc.hl and nvslvm.hl build artifacts

The workflows install Haxe and HashLink on Linux before running the build and sample checks.

Main Commands

Main Entry Points

License

MIT. See LICENSE.

Contributors
bymehul
Version
0.4.0
Published
5 weeks ago
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub