Neyuki
/neˈjuːki/ — neh-yoo-kee. From 根雪, the base layer of snow that settles early and stays all winter.
Neyuki is a small, Lua-like scripting language implemented in Rust. It is designed to be familiar to anyone who has used Lua or Luau, while keeping the surface area small and the runtime straightforward.
The project currently includes:
- a lexer and parser for
.nyksource files - a compiler pipeline for syntax validation
- a small runtime with builtins like
print,assert,try, andrequire - a bundled library example (
@neyuki/math) - a VS Code extension for syntax highlighting in the sibling
editor-extensions/neyukifolder
Why Neyuki?
Neyuki aims to feel lightweight and readable without the usual Lua rough edges:
- variables are introduced with
local,const, orglobal - functions are first-class values
- control flow includes
if,elseif,else,while,repeat,for,break, andcontinue - numbers, strings, and tables are the core runtime values
- module-style loading is supported through
require()for bundled packages
Project layout
neyuki/
├── Cargo.toml
├── README.md
├── examples/
│ └── hello.nyk
├── lib/
│ └── math.nyk
├── src/
│ ├── compiler.rs
│ ├── lexer.rs
│ ├── lint.rs
│ ├── main.rs
│ ├── parser.rs
│ ├── runtime.rs
│ └── tests.rs
├── tests/
│ ├── control_flow_and_types.nyk
│ ├── number_stress.nyk
│ └── runtime_and_errors.nyk
└── target/
Quick start
From the project root:
Example
const
print
Running it:
Output:
55
Supported language features
The current compiler/runtime supports a practical subset of a Lua-like language:
- variable declarations with
localandconst - function declarations and calls
- typed variadic parameters (
...) and vararg expansion in tables and calls - postfix increment and decrement statements (
++and--) - arithmetic, comparisons, and boolean logic
if/elseif/elseblockswhileandrepeatloopsforloops over table values- strings and string interpolation using
{...}inside quoted literals - table literals and indexed access
- builtins:
print,tostring,type,typeof,assert,int,float,try, andrequire
Builtins
A few runtime functions are available in the base environment:
print
assert
tostring
type
typeof
int
float
The try builtin is used for safe calls:
local ok, err = try
if not ok
Bundled library example
The runtime currently recognizes a bundled package named @neyuki/math:
local math = require
print
Editor support
The repository also includes a VS Code extension under editor-extensions/neyuki for .nyk syntax highlighting and editor tooling.
The detailed language and runtime references are in docs/.
Status
This project is still in active development. The grammar and runtime are intentionally compact, and the test suite under tests/ is the best way to validate behavior as features evolve.
License
This project is licensed under the MIT License. See LICENSE for details.