Everything you need,
nothing you don't.
Yen combines the best ideas from modern languages into a clean, expressive syntax that gets out of your way.
|x| x * 2 syntax. Support expression bodies, block bodies, default parameters, and full closures.
match expressions with literal patterns, ranges, guards, and wildcards for expressive control flow.
data |> transform |> output. Makes data pipelines readable and composable.
go and communicate safely through buffered channels. Built-in async module.
this binding.
[...a, ...b], destructure with let [x, y] = list, and spread args in function calls.
defer for automatic cleanup on scope exit.
process_shell(), manage files, environment variables, and automate OS tasks natively.
Expressive by design.
See how Yen makes complex tasks simple with clean, readable syntax.
// Variables: let = immutable, var = mutable
let name = "Yen";
var count = 0;
count++;
// Functions with default parameters
func greet(name, greeting = "Hello") {
print greeting + ", " + name + "!";
}
// Pattern matching with guards
match (score) {
90..=100 => "A";
n when n >= 80 => "B";
n when n >= 70 => "C";
_ => "F";
}
// Lambdas and closures
let square = |x| x * x;
let add = |a, b = 10| a + b;
// Pipe operator
let result = 5 |> square |> add;
// Lists with negative indexing & slicing
let nums = [1, 2, 3, 4, 5];
print nums[-1]; // 5
print nums[1:3]; // [2, 3]
// Higher-order functions
let evens = filter(nums, |x| x % 2 == 0);
let doubled = map(nums, |x| x * 2);
let total = reduce(nums, 0, |a, b| a + b);
// Maps and destructuring
let user = {"name": "Alice", "age": 30};
for [key, val] in map_entries(user) {
print key + ": " + str(val);
}
// Spread operator
let a = [1, 2];
let b = [3, 4];
let merged = [...a, ...b]; // [1,2,3,4]
// Ternary & null coalescing
let label = total > 10 ? "big" : "small";
let val = find(nums, |x| x > 99) ?? 0;
// Structs
struct Point { x; y; }
let p = Point { x: 10, y: 20 };
// Classes with methods
class Person {
let name;
let age;
func init(name, age) {
this.name = name;
this.age = age;
}
func greet() {
print "Hi, I'm " + this.name;
}
}
// Enums
enum Color { Red, Green, Blue }
let person = Person { name: "Yen", age: 1 };
person.greet();
import 'async';
import 'net.http';
import 'os';
// Goroutines with channels
let ch = chan(10);
func producer(channel) {
for i in 0..5 {
send(channel, i * 10);
}
close_chan(channel);
}
go producer(ch);
// Error handling with defer
func safe_read(path) {
defer log_info("Done reading");
try {
return io_read_file(path);
} catch (e) {
log_error("Failed: " + e);
return None;
}
}
Batteries included.
12 built-in standard library modules plus 6 importable modules cover everything from math to networking.
Standard Library
Import Modules
Higher-Order Functions
Up and running in 60 seconds.
Clone, build, and run your first Yen program.
Clone
Get the latest source from GitHub
git clone https://github.com/yen-lang/Yen.git
Build
Compile with CMake
cd Yen && mkdir build && cd build
cmake .. && make yen
Run
Execute your first program
./yen hello.yen
Learn more.
Comprehensive guides and references for everything in Yen.
Language Syntax
Complete reference for variables, functions, control flow, pattern matching, OOP, and all operators.
Read docs →Standard Library
API reference for all 12+ built-in modules with examples and function signatures.
View API →Quick Start Guide
Get up and running fast with a guided walkthrough of Yen's core features.
Get started →Using Yen
Practical guide to writing scripts, shell integration, and building real applications.
Read guide →