About
Yen is a lightweight, expressive, and interpreted programming language inspired by Python, Nim, C++, and Rust. Built with performance and simplicity in mind, Yen aims to bring structure and clarity to scripting.
Features
- 🧠 Variables, Functions, Structs and Classes
- 🔄 Match, Switch, Loops and Conditions
- 🧩 Enum support
- 🛠️ Dynamic typing with runtime safety
- 📥 Built-in input/output and standard operations
- 🌐 Linux supported (Windows/macOS coming soon)
Getting Started
To build and run a Yen program on Linux:
git clone https://github.com/yen-lang/Yen
cd Yen
g++ -std=c++17 -o yen main.cpp lexer.cpp parser.cpp compiler.cpp
./yen examples/hello_world.yl
Example Program
Terminal - Yen
# Single-line comment
/* Block comment
still running
ends here */
func greet(name) {
print "Hello, " + name + "!";
}
func add(a, b) {
return a + b;
}
func check_age(age) {
if (age >= 18) {
print "You are an adult.";
} else {
print "You are a minor.";
}
}
func types_and_casting() {
let text = "123";
let integer = int(text);
let decimal = float("3.14");
let boolean = bool("true");
let converted = str(999);
print "Original text: " + text;
print "Converted to int: " + integer;
print "Converted to float: " + decimal;
print "Converted to bool: " + boolean;
print "Converted to string: " + converted;
let sum = integer + 7;
print "Sum (int + int): " + sum;
let total = decimal + 2.86;
print "Sum (float + float): " + total;
let mixed = "Value: " + total;
print mixed;
}
func interact() {
let name = input("What is your name?");
let age = input("How old are you?");
greet(name);
check_age(age);
let result = add(10, 5);
print "10 + 5 = " + result;
types_and_casting();
}
interact();
Contributing
We welcome contributions!
Fork the repo, make your changes, and submit a pull request.
See CONTRIBUTING.md for full contribution guidelines.
License
Yen Language is open-source under the MIT License.