Skip to content

yen-lang/Yen

Repository files navigation

YEN Programming Language

YEN Logo

A modern, expressive programming language

License: MIT C++17


Quick Start

git clone https://github.com/yen-lang/Yen.git
cd Yen
mkdir build && cd build
cmake ..
make
./yen --version

Create hello.yen:

print "Hello, World!";
./yen hello.yen

Features

// Variables
let name = "Alice";       // immutable
var count = 0;            // mutable

// Functions
func greet(name) {
    print "Hello, " + name;
}

// Lambdas
let square = |x| x * x;

// Pattern matching
match (score) {
    0..60 => print "F";
    60..80 => print "C";
    80..100 => print "A";
    _ => print "Invalid";
}

// Classes and structs
class Person {
    let name;
    let age;

    func greet() {
        print "I'm " + this.name;
    }
}

// Lists and iteration
var nums = [1, 2, 3, 4, 5];
for n in nums {
    print square(n);
}

// Defer, try/catch, ranges, destructuring, spread, pipes, and more

Standard Library

Module Examples
Math math_sqrt, math_pow, math_random
String str_split, str_upper, str_replace
Collections list_sort, list_reverse, list_push
IO / FS io_read_file, io_write_file, fs_exists
Time time_now, time_sleep
Crypto crypto_hash, crypto_random_bytes
Encoding encoding_base64_encode, encoding_hex_encode
Log log_info, log_warn, log_error
Env / Process env_get, process_exec

Documentation

Testing

cd tests
./run_tests.sh

Contributing

See CONTRIBUTING.md.

License

MIT License

About

Yen is a lightweight, dynamic and expressive programming language, designed to combine the best ideas from Python, Rust, and C++. It prioritizes simplicity, fast interpretation, and modern programming structures like functions, structs, enums, classes, match/case, and more.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors