v1.0 Released — 39 Tests Passing

Write Code That
Feels Natural

A modern, expressive programming language with pattern matching, lambdas, pipes, goroutines, and 12+ built-in modules. Build anything from scripts to servers.

Get Started See Examples Learn Yen
12+
Stdlib Modules
16+
Higher-Order Fns
6
Import Modules
39
Tests Passing

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.

λ
Lambdas & Closures
First-class functions with concise |x| x * 2 syntax. Support expression bodies, block bodies, default parameters, and full closures.
Pattern Matching
Powerful match expressions with literal patterns, ranges, guards, and wildcards for expressive control flow.
Pipe Operator
Chain transformations naturally with data |> transform |> output. Makes data pipelines readable and composable.
Goroutines & Channels
Spawn concurrent tasks with go and communicate safely through buffered channels. Built-in async module.
{ }
Structs, Classes & Enums
Full OOP support with structs, classes with constructors and methods, enum types, and this binding.
Spread & Destructuring
Unpack lists with [...a, ...b], destructure with let [x, y] = list, and spread args in function calls.
Higher-Order Functions
16+ built-in HOFs: map, filter, reduce, sort_by, flat_map, zip, enumerate, group_by, take, drop, and more.
Try/Catch & Defer
Structured error handling with try/catch/finally blocks. RAII-style defer for automatic cleanup on scope exit.
Shell Integration
Execute system commands with 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.

fundamentals.yen
// 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;
collections.yen
// 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;
oop.yen
// 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();
async_server.yen
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

𝑓
math
Trig, random, pow, sqrt
A
string
Split, join, trim, replace
collections
Push, sort, flatten, unique
core
Type checking & conversion
📄
io
Read, write, append files
📁
filesystem
Exists, mkdir, remove, size
time
Timestamps and sleep
🔒
crypto
XOR, hash, random bytes
🔄
encoding
Base64 and hex encoding
📝
log
Info, warn, error logging
env
Environment variables
💻
process
Shell exec, spawn, cwd

Import Modules

async
Goroutines & channels
*
regex
Match, search, replace
🌐
net.socket
TCP & UDP sockets
📡
net.http
HTTP server & URL encode
🖥
os
Platform, exec, filesystem
🔗
net
General networking

Higher-Order Functions

map
filter
reduce
foreach
sort_by
find
any
all
flat_map
zip
enumerate
take
drop
map_filter
group_by
map_map_values
Official Course

Yen Language Programming for Beginners

Start your journey with Yen from scratch. This course covers the fundamentals of the language, from variables and functions to pattern matching, lambdas, and building real projects.

Beginner-friendly
Hands-on examples
Full language coverage
Project-based
Start Learning

Up and running in 60 seconds.

Clone, build, and run your first Yen program.

01

Clone

Get the latest source from GitHub

git clone https://github.com/yen-lang/Yen.git
02

Build

Compile with CMake

cd Yen && mkdir build && cd build
cmake .. && make yen
03

Run

Execute your first program

./yen hello.yen