Neyuki
/neˈjuːki/ — neh-yoo-kee. From 根雪, the base layer of snow that settles early and stays all winter.
Neyuki is a small scripting language for everyday programs: automation, command-line tools, little servers, quick windows and games. It reads like Lua, ships as one executable with no dependencies, and comes with the libraries those jobs need.
local fs = require
-- count the lines in every Neyuki file under src/
local total = 0
for _, path in fs.
print
What it gives you
- A familiar language. Lua's tables, closures, metatables and coroutines, a Luau-style
taskscheduler, plus!=,??,+=,continue,`{interpolation}`andfunction T:method(). - Exact integers. Integers never overflow or lose precision;
2 ^ 100is exact. - Optional types, checked before running.
local n: number = "x"is reported with its line before anything executes, andneyuki lintshows the same diagnostics in your editor. - Batteries for daily work. Files and paths, JSON, dates, running programs, HTTP client and server, PostgreSQL and MySQL, hashing and encryption, windows with 2D drawing and animation, and keyboard and mouse automation.
- One executable. Pure Rust, no C toolchain, no runtime to install. Scripts can also be compiled to verified bytecode.
Install
Build from source with a recent stable Rust:
The executable is target/release/neyuki (neyuki.exe on Windows); put it on your PATH.
Use
Documentation
- The language: syntax, values, tables, functions, objects and modules
- Library reference: every function, with examples
- Tools and runtime: the CLI, lint, bytecode, packages and limits
- Examples
The VS Code extension in the sibling editor-extensions/vscode folder adds highlighting, completion with documentation, live diagnostics, snippets and debugging.
Project layout
src/
├── main.rs the command-line interface
├── parser/, lexer.rs tokenizer and parser
├── ast/ syntax tree, spans and visitors
├── sema/ scopes, const and type checks
├── lint/ `neyuki lint`
├── compiler/ constant folding, SSA IR, optimization passes, register allocation, codegen
├── bytecode/ instruction format, serializer, verifier, disassembler
├── vm/ register VM, garbage collector
│ └── libs/ standard libraries and the natives behind lib/*.nyk
├── repl.rs, dap.rs REPL and debug adapter
└── diagnostics/
lib/ bundled @neyuki/* modules written in Neyuki
tests/ .nyk test scripts (`neyuki test`)
bench/, fuzz/ `neyuki bench` and `neyuki fuzz`
docs/
cargo test runs the Rust tests and every script in tests/.
Community
- Discord: https://discord.gg/mvCB3KnAT4
- GitHub: https://github.com/neyuki-lang
Contributions are welcome; see CONTRIBUTING.md. To report a security vulnerability, follow SECURITY.md instead of opening a public issue.
License
MIT. See LICENSE.