Simplicity and humor, powered by a custom virtual machine.

Designed with both simplicity and humor in mind, Manisa Engereği is a dynamically typed programming language that brings a fresh, playful perspective to software development. Despite its light-hearted Turkish keywords, it is a fully functional system complete with its own bytecode compiler and stack-based virtual machine. By intentionally stripping away extraneous control structures, it encourages developers to focus strictly on pure logic and flow.

# The minimalist way to say Hello
çıktı("Merhaba Dünya");
# The recursive factorial, highlighting native syntax style
marifet faktöriyel(n) {
    şayet (n == 0) {
        tebliğ 1;
    }
    tebliğ n * faktöriyel(n - 1);
}

değişken sonuç = faktöriyel(5);
çıktı("Sonuç: " + cümle(sonuç));
# Opens a file handle.
sabit dosya_handle = ("test.txt", "r");
# Read all bytes (-1)
sabit içerik = oku(dosya_handle, -1);
kapat(dosya_handle);

çıktı(içerik);
sabit hmm = girdi("Bir şeyler: ");
çıktı("Girdi: " + hmm);
# The parser doesn't halt on the first error, it recovers!
sabit a = 1;
sabit b = 2 # Expected semicolon (Throws diagnostic instead of halting)

# Recovers state and continues parsing
değişken c = 3;

şayet (1 == 1 { # Expected ')' after condition
    c++;
}

Custom VM

Compiles down to compact, linear bytecode. A custom stack-based Virtual Machine executes 1-byte opcodes flawlessly utilizing an Instruction Pointer, operand decoding, and a robust constant pool.

📦

Unified Objects

From constants to built-in functions, all elements operate as a polymorphic MEObject*. This unified foundation makes memory management predictable via a manual reference counting garbage collector.

🛡️

Resilient Compiler

Frustrated by compilers that panic on the first mistake? Our Lexer and Parser recover gracefully from unexpected tokens, analyzing the entire file to provide a comprehensive diagnostic report.

Ruthless Minimalism

Omitting syntactical clutter like for loops and switch statements enforces a highly consistent, uniform programming style. With just şayet (if) and madem (while), the language is delightfully small.

Getting Started

# Clone the repository
$ git clone https://github.com/rft0/manisa-engeregi

# Build and run the executable
$ make && ./bin/me deneme.me
# Clone the repository
$ git clone https://github.com/rft0/manisa-engeregi

# Build using CMake
$ mkdir -p build && cd build
$ cmake .. && cmake --build .

# Run the executable
$ .\bin\me.exe deneme.me

Language Details

Dynamic Typing & Unified Objects

Manisa Engereği uses dynamic typing (değişken for variables, sabit for constants). You never need to declare types explicitly. Furthermore, everything in the language is an object extending the MEObject* base struct—meaning numbers, strings, and even built-in functions share the same polymorphic traits.

sabit pi = 3.14;
değişken isim = "Engerek";
# Both are treated as MEObjects internally

Expressive Turkish Syntax

The standard library and keywords are fully localized. Instead of common keywords, you use constructs like şayet (if), değilse (else), madem (while), ve (and), and yahut (or). Want to define a new function? Just show off your marifet (skill/method)!

şayet (x > 9 ve x < 100) {
    çıktı("Sayı iki basamaklı");
}

Resilient Frontend & Type Casting

The lexer and parser are designed to recover gracefully rather than failing aggressively on syntax errors. Plus, type casting is incredibly natural: use ondalık("3") to cast to a float or cümle(3.14) to cast to a string automatically.

çıktı(cümle(3.14) + "hmm"); # Prints "3.14hmm"

For more info and in-depth technical documentation,

Visit the Technical Documentation ➔