Nari is a dynamically typed scripting language designed for rapid development with support for asynchronous programming, first-class functions, and seamless C interoperability through its foreign function interface. The language combines modern features with a straightforward syntax, making it suitable for both quick scripts and more complex applications.
Install the latest release with the bootstrap script (never uses sudo; installs
into ~/.nari and adds it to your PATH):
curl -fsSL https://raw.githubusercontent.com/nari-lang/nari/main/install.sh | shPass --with-npkg to also install the npkg
package manager. To uninstall, run uninstall.sh from the same location.
There's no Windows installer yet, so install from the release archive:
- Download
nari-<version>-windows-x86_64.zip(or-arm64.zipon ARM) from the Releases page. - Extract it somewhere stable, e.g.
C:\Program Files\Nari. - Add that folder's
bin\directory to yourPATHsonariandnaricare available from any terminal.
Execute a Nari script file:
nari script.nariCompile a script to bytecode:
naric script.nari -o script.naric
nari script.naricSee EDITOR_SUPPORT.md for information on the VS Code extension, nari-lsp, debugging, syntax highlighting, and editor integration.
Comprehensive documentation is available in the docs/ directory:
- Language Overview: Introduction to Nari and its design philosophy
- Syntax Basics: Variables, comments, and fundamental syntax
- Data Types: Primitives, arrays, objects, and type checking
- Operators: Arithmetic, logical, comparison, and special operators
- Control Flow: Conditionals, loops, and flow control
- Functions: Function declarations, closures, and advanced patterns
- Custom Types: Type declarations and annotations
- Asynchronous Programming: Spawn blocks and event loop usage
- Modules: Import system and code organization
- Error Handling: Value-based error handling with Result/Option
- Built-in Functions: Core globally available functions
- Standard Library: System, math, I/O, HTTP, and networking modules
- String Methods: String manipulation operations
- Array Methods: Array utilities and transformations
- Object Methods: Working with objects and maps
- Generics and Enums: Generic types and algebraic data types
- C FFI: Foreign function interface for calling C libraries
- Classes: Object-oriented programming with classes
- Bytecode:
.naricfiles, verifier guarantees, and compiled module imports
The examples/ directory contains sample programs demonstrating various language features:
class_character.nari: Character class implementationclass_library.nari: Library management system using classesgenerics_enums_example.nari: Generic types and enum usagehttp_client.nari: HTTP client examplehttp_server.nari: Simple HTTP server implementationraylib_bouncing_ball.nari: Graphics demo using Raylib via FFIwinapi_showcase.nari: Windows API integration examples
./build_deps.sh
./build.shBy default this creates a debug build in build/debug/:
build/debug/naribuild/debug/naricbuild/debug/nari-lspwhen LSP support is enabled
For a release build:
./build.sh --releaseRelease artifacts are placed in build/release/.
To build against distro packages instead of Conan:
./build.sh --system-deps --releaseDependencies are resolved via pkg-config / the default linker paths, and the build uses the system toolchain and standard library.
Preferred (system) packages:
libcurlmbedtlslibffilibarchivezlibasmjitreplxx(plus their headers).
Any dependency not found on the system is fetched and built automatically from
a Meson wrap in
subprojects/ (WrapDB for curl/zlib/libffi/libarchive; pinned Git + CMake for
asmjit/replxx/mbedtls). A normal --system-deps build therefore succeeds even
on distros that do not package asmjit or replxx.
asmjit and replxx are also optional at the feature level: configure with
-Ddisable_jit=true / -Ddisable_repl=true to drop them entirely.
Packagers who need reproducible, network-isolated builds can control the
fallback with Meson's --wrap-mode:
--wrap-mode=nofallback— never build subprojects; require system copies (missingasmjiterrors, missingreplxxjust disables the REPL).--wrap-mode=nodownload— only use sources already vendored undersubprojects//subprojects/packagecache/(no network fetch).
Packaging scripts can also call Meson directly:
meson setup build --buildtype=release -Dsystem_deps=true
meson compile -C buildArtifacts land in build/sysdeps-release/ when using build.sh.
For reduced binary size and memory usage, you can disable FFI and HTTP networking:
./build_minimal.shUse the PowerShell build script from a normal PowerShell prompt:
.\build.ps1 # debug
.\build.ps1 -Release # release
.\build.ps1 -ClangCl # clang-cl instead of MSVCSee BUILD_WINDOWS.md for detailed native Windows and Wine-based cross-build instructions.
./build.sh --emscriptenThis creates a WebAssembly build suitable for running in web browsers.
./run_tests.sh # release build, default bytecode VM path
./run_tests.sh --debug # debug build
./run_tests.sh --tree-walkNari is implemented in C++20 and includes:
- Custom parser and abstract syntax tree representation
- Tree-walking interpreter and bytecode VM with runtime type checking
- Garbage collector for automatic memory management
- Class system with inheritance and encapsulation (see Classes)
- Integration with libffi for dynamic C function calls
- Embedded standard library compiled into the interpreter binary
src/: Core interpreter, runtime, bytecode VM/compiler, debugger, DAP server, JIT, GC, and builtinssrc/stdlib/: Standard library implemented in Nari and embedded into normal buildsdocs/: Language documentationexamples/: Example programstests/: Passing, expected-failing, dependency, and robustness testslsp/: C++ language server plus the VS Code extension underlsp/extension/npkg-frontend/: Package-manager CLI, registry server, and web frontend experimentsesp_idf_project/: ESP-IDF / embedded experimentstools/: Build and code-generation utilitiestoolchain/: Meson cross/native toolchain filesthirdparty/: Vendored or manually managed third-party sources; most normal dependencies are installed through Conanworkspace/: Local experiments and scratch files; this directory is gitignored
This project is licensed under the GNU General Public License v3.0. See LICENSE for details.
However, despite being licensed under the GPL, you are more than welcome to contact me if you're interested in using Nari for a proprietary project. I'm open to discussing alternative licensing arrangements on a case-by-case basis, and I would love to see Nari used in a wide variety of projects, both open source and commercial!