What is Nyx?
Nyx is a simple, interpreted, dynamically-typed scripting language for scripting, data manipulation, and system/graphics interaction via its standard library. Designed for simplicity and ease of use.
Prerequisites
Section titled “Prerequisites”- Xmake: A C/C++ build system. (See xmake.io)
- C++17 Compiler: Such as GCC, Clang, or MSVC.
- SDL2 Libraries (Optional, for
std:sdl
module):- SDL2 (version >=2.0.12)
- SDL2_ttf (version >=2.0.15)
Build from Source
Section titled “Build from Source”- Navigate to the root directory of the Nyx project.
- Build using Xmake:
Terminal window xmake
Install system-wide
Section titled “Install system-wide”After a successful build, you can install the nyx
interpreter to a system location (e.g., /usr/local
):
sudo xmake install --root
Running Nyx Scripts
Section titled “Running Nyx Scripts”Once nyx
is built (and optionally installed), you can run Nyx scripts:
nyx /path/to/your_script.nyx [script_arguments...]
Example:
nyx examples/snake_game/snake_game.nyx
To see the interpreter’s command-line options:
nyx --help