use std.core
fn greet(str name) str {
"Hello, " + name + "!"
}
print(greet("Nytrix"))
assert(greet("Nytrix") == "Hello, Nytrix!", "greet")./make ny -run hello.ny
./make ny -o hello hello.ny
./hello
./make ny https://raw.githubusercontent.com/x3ric/xtool/refs/heads/main/xtoolchmod +x make
./make
./make install
ny --versionUse python3 ./make if your shell does not execute ./make directly.
use std.core
enum Shape {
Circle(int radius),
Empty
}
fn area(shape) int {
match shape {
Shape.Circle(r) -> r * r
Shape.Empty -> 0
}
}
assert(area(Shape.Circle(4)) == 16, "area")ADT payloads use Type name in declarations and positional values in constructors and match patterns.
use std.core
def base = comptime{ 2^5 }
def shifted = comptime{ range(4).map(fn(i){ i + base }) }
assert(base == 32, "comptime value")
assert(to_str(shifted) == "[32, 33, 34, 35]", "comptime list")use std.core
layout Vec2 pack(4) {
f32 x,
f32 y
}
#include <math.h> as "cos"
assert(cos(0.0) == 1.0, "cos")Layouts use Type name fields. A colon may still parse as an implicit separator only where the grammar would otherwise be unambiguous.
| Path | Purpose |
|---|---|
src/ |
Compiler, runtime, and tools. |
lib/ |
Standard library. |
etc/tests/ |
Tests. |
etc/projects/ |
Examples and demos. |
Use Discord, GitHub issues, or nytrixlang@gmail.com for questions, bugs, docs, and feedback.
Send security reports privately by email with the affected commit, platform,
command, proof of concept. Reports are voluntary; there is no paid
bounty program right now ;(.
Discuss feature direction on Discord or by email.
Pin a commit for reproducible builds and check docs/CHANGELOG.md before upgrading.
MIT. See LICENSE.