Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

BERK Programming Language

BERK, designed with true bilingual syntax (Turkish/English) for the first time in the world,embedded systems and AI/ML productionIt is a high-performance system programming language optimized forC/C++ level performanceIt provides productivity on 19 different target platforms (ARM Cortex-M, RISC-V, ESP32, x64/ARM desktop, WebAssembly).

📖 Why was the name BERK chosen?

Öztürk Origin: "Strong, Strong, Solid"

BERKthe word in Öztürk"strong, durable, strong and solid"means. These qualities directly align with the technical goals of the programming language: memory safety, type system correctness, strong compiler architecture, and stable performance.

Meaning from Arabic: "Lightning"

Another meaning found in Turkish is **"lightning"**. This meaning represents the BERK language's vision of speed, performance and agility: fast compilation based on LLVM, C++-level performance and optimized kernel architecture.

Combination of Meanings

BERK, both of Turkish originrobustnessconcept as well as in the world of modern technologyspeed and agilityIt creates a strong brand identity by combining concepts.

Internationally

BERK,Beyond-Efficient Runtime Kernel(Runtime Core Beyond Efficiency).


📥 Download and Installation

Windows x64 (v1.0.0)

Latest Version:BERK v1.0.0 (December 2, 2025)
Dimension:~3.8 MB (3 files)
Platform:Windows 10/11 (64-bit)

🔗 Download Links

Setup

# 1. BERK-lang.exe'yi indirin
# 2. İstediğiniz bir klasöre kopyalayın (örn: C:\BERK)
# 3. PATH'e ekleyin:
$env:PATH += ";C:\BERK"

# Test edin
BERK-lang --version

Quick Start

Option 1: Interactive REPL (Instant Test)

# REPL'i başlatın
BERK-lang repl

# Kod yazın and Enter'a basın - anında çalışır!
>>> print("Merhaba, BERK!")
Merhaba, BERK!

>>> let x = 5 + 3
>>> print(x * 2)
16

Option 2: Compilation (Native Executable)

# İlk programınızı yazın (merhaba.berk)
function main() -> int
do
    print("Merhaba, BERK!")
    return 0
end

# LLVM ile native kod üretin
BERK-lang compile merhaba.berk -o merhaba.exe

# Çalıştırın (artık bağımsız executable)
.\merhaba.exe

Option 3: Running JIT (Compile + Run)

# Direkt çalıştır (arka planda LLVM JIT)
BERK-lang run merhaba.berk

Other Platforms

Linux and macOS:Compilation from source code is required.

# Rust toolchain kurulumu
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# BERK'u derleyin
git clone https://github.com/ArslantasM/berk
cd berk/berk-lang
cargo build --release --features llvm

🌟 Features That Make BERK Special

🔧 Optimized for Embedded Systems and AI/ML

BERK,embedded systems and artificial intelligence productionIt is a language designed for:

  • Bare-Metal Programming: Direct hardware access without RTOS
  • ARM Cortex-M/RISC-V Support: Popular MCUs such as STM32, ESP32, Nordic nRF
  • Minimal Runtime: 2-5 KB memory overhead, ideal for critical applications
  • AI/ML Inference: ONNX Runtime integration, libraries optimized for edge AI
  • High-Performance Computing: SIMD, vectorization, zero-cost abstractions
  • Real-Time Guarantees: Deterministic timing, interrupt handling, DMA support
  • Cross-Compilation: Compiling to ARM/RISC-V targets with a single command from Desktop

🌍 World's First: True Bilingual Syntax

For the first time in programming languages,in the same compilerYou can write code with both Turkish and English keywords. This is not just a translation, it is an inherent feature of the language.

⚡ C/C++/Rust Level Performance + AI/ML Optimization

  • LLVM Backend: Zero cost abstractions with native code generation
  • Benchmark Results: 98-100% performance equality with C++
  • AI/ML Workloads: Inference (edge ​​devices) of TensorFlow/PyTorch models with ONNX
  • SIMD/Vectorization: AVX2, NEON, RISC-V Vector extension support
  • Memory Efficiency: Manual control + security guarantees, critical for embedded
  • Optimization Levels: Aggressive optimization between O0-O3 + LTO (Link-Time Optimization)
  • Embedded ML: TinyML, quantization, model compression support

🧠 Rules-Based AI Approach + ML Production

Compiler,rule based artificial intelligenceUsing techniques:

  • Intelligent error detection and recommendations (AI-powered error recovery)
  • Code optimization decisions (ML-guided optimization)
  • Type inference and analysis (static analysis + inference)
  • Quality assurance with semantic analysis

AI/ML Production Pipeline:

  • Model Training: Training with Python/PyTorch, ONNX export
  • Model Optimization: Quantization (INT8/INT16), pruning, distillation
  • Edge Deployment: inference on ARM Cortex-M, ESP32, RISC-V
  • Real-Time Inference: <10ms latency, AI on embedded devices
  • TinyML Support: TensorFlow Lite, ONNX Runtime integration
  • Hardware Acceleration: NPU, DSP, GPU offloading (Metal, CUDA, Vulkan)

🔬 Comprehensive Standard Library (stdlib v0.9.4)

75 modules(42 stdlib + 33 HAL),4100+ functions, 1140KBcode:

  • Scientific Calculation: math, linalg, stats, optim, physics, complex, random
  • Embedded Systems (HAL): 33 modules - GPIO, UART, SPI, I2C, WiFi, Bluetooth, Timer, DMA
  • 7 Platform Support: ESP32, STM32F4, RP2040, nRF52, GD32, Nuvoton, Arduino
  • Web & Data: http, json, xml, yaml, csv, sqlite, async
  • Graphics & Gameplay: gui, graphics, audio, image, physics2d, cad3d
  • NumPy/SciPy/Julialevel scientific computing

🚀 19 Different Target Platforms (Embedded-First)

Cross-compilation support:

  • Embedded (Priority): ARM Cortex-M0/M3/M4/M7, RISC-V (32/64-bit), AVR, ESP32/ESP8266, Nordic nRF52/nRF53
  • desktop: Windows (x64/ARM), Linux (x64/ARM/RISC-V), macOS (Intel/Apple Silicon)
  • Mobile: Android (ARM/x86), iOS (ARM64)
  • WebAssembly: Browser and server (WASI)
  • Cloud: AWS Lambda, Azure Functions, Google Cloud Run
  • IoT Platforms: Raspberry Pi, BeagleBone, NVIDIA Jetson (edge ​​AI)

Supported MCU Families:STM32, ESP32, Nordic nRF, Microchip SAM, TI MSP430, SiFive HiFive, Kendryte K210

📚 Extremely Easy to Learn

  • Intuitive Syntax: The simplicity of Python + the power of Rust
  • Turkish Documentation: 70+ pages comprehensive guide
  • Clear Error Messages: With solution suggestions
  • Learning Curve: Be productive in 1-2 weeks

🔧 Advanced Embedded System Capability

  • Bare-metal Programming: Hardware control (GPIO, UART, SPI, I2C) without RTOS
  • RTOS Integration: Works seamlessly with FreeRTOS, Zephyr, RIOT-OS
  • HAL Abstractions: Platform-agnostic hardware layer (ARM, RISC-V, AVR)
  • Interrupt Handling: Zero-overhead interrupt handlers, nested interrupts
  • DMA Support: Direct memory access, asynchronous data transfers
  • Power Management: Sleep modes, low-power optimization, battery-powered devices
  • Minimal Runtime: 2-5 KB overhead, works even on 8-bit MCUs
  • Bootloader Support: OTA updates, secure boot, firmware signing

Why BERK?

🎯 For Academics and Researchers

  • Scientific Calculation: NumPy/SciPy/MATLAB level libraries
  • Performance: C++ speed, Python ease
  • reproducibility: Deterministic compilation, reproducible builds
  • Publishing: Ideal for Turkish academic publications

💼 For Industry Professionals

  • Production-Ready: Performance comparable to C/C++/Rust
  • Cross-Platform: Single codebase, 19 platforms
  • Maintainability: Readable code, easy refactoring
  • interoperability: C/C++ FFI, integration into existing systems
  • Cost-Effective: Less bugs, faster development

🎓 For Educators and Students

  • Turkish Content: Learning programming in native language
  • Modern Concepts: Type safety, pattern matching, error handling
  • Easy Pass: Natural for coming from Python, bridge to C++
  • Practical Examples: Real world applications

1. World's First: True Bilingual Syntax

// Türkçe
function selamla(isim: yazı) -> yazı
do
    return "Merhaba, " + isim + "!"
end

// English (aynı derleyici!)
function greet(name: string) -> string
do
    return "Hello, " + name + "!"
end

// Karışık kullanım bile mümkün
function hesapla(sayı: int) -> int
do
    if sayı > 0
        return sayı * 2
    else
        return 0
    end
end

2. Modern and Safe

  • ✅ Powerful type system
  • ✅ Memory security
  • ✅ Null safety
  • ✅ Pattern matching
  • ✅ Error handling

3. High Performance + LLVM Backend

  • Native code generation -98-100% performance parity with C++
  • Support for 19 different architectures (x64, ARM, RISC-V, WebAssembly, ...)
  • Optimization levels (O0-O3)
  • Cross-compilation -one code, 19 platforms
  • Zero-cost abstractions
  • Inline assembly support

4. Comprehensive Standard Library (stdlib v0.9.4)

use linalg, stats, optim

// Linear Algebra
let A = linalg.matris_oluştur([[1, 2], [3, 4]])
let B = linalg.matris_çarp(A, linalg.transpose(A))
let (L, U) = linalg.lu_ayrıştır(A)

// İstatistik
let veri = [1.2, 2.3, 3.4, 4.5, 5.6]
let ort = stats.avg(veri)
let std = stats.standart_sapma(veri)
let (r, p) = stats.korelasyon(x, y)

// Optimizasyon
let minimum = optim.gradient_descent(function, x0, öğrenme=0.01)
let sonuç = optim.bfgs(maliyet, başlangıç)

4. Developer Friendly

  • Comprehensive documentation (70+ pages, Turkish)
  • Clear error messages (with suggested solutions)
  • VS Code plugin (syntax highlighting, autocomplete, debugging)
  • REPL (interactive shell) - instant testing
  • Rich testing infrastructure
  • easy learning: productive with 1-2 weeks

Quick Start

Setup

# Rust toolchain gerekli
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# BERK'u derle
git clone https://github.com/ArslantasM/berk
cd berk/berk-lang
cargo build --release --features llvm

# PATH'e ekle
export PATH="$PWD/target/release:$PATH"

Your First Program

// merhaba.berk
function main() -> int
do
    print("Merhaba, BERK!")
    return 0
end
# Derle ve çalıştır
BERK-lang merhaba.berk -o merhaba.exe
./merhaba.exe
# Çıktı: Merhaba, BERK!

About This Book

This book is a comprehensive resource for learning the BERK programming language.Rust BookAndPython DocumentationIt has been prepared by bringing together the best aspects of resources such as.

Target group

  • Beginners to programming
  • Experienced developers
  • System programmers
  • Developers looking for Turkish content

How Should You Use the Book?

  1. Sequential Reading: We recommend that you read it in order from beginning to end.
  2. Try Examples: Run each example on your own computer
  3. Exercises: Do the exercises at the end of each chapter
  4. Reference: Return to the reference sections whenever you need

Philosophy of Language

BERK's basic design principles:

1. accessibility

Thanks to Turkish keywords, entry into programming has been made easier for those who do not speak English.

2. Security

Catches memory errors at compile time. It minimizes runtime errors.

3. Performance

It offers C/C++ level performance thanks to the LLVM backend.

4. Legibility

Clear and understandable syntax. It is optimized for reading code rather than writing code.

5. interop

Compatible with C/C++ libraries. It can integrate into existing ecosystems.

Highlights

Modern Type System

let x: int = 42
let isim: yazı = "Ahmet"
let aktif: bool = true
let sayılar: List<int> = [1, 2, 3]
let nokta: Tuple<int, int> = (10, 20)

Pattern Matching

match case mesaj
    case "başarılı":
        print("İşlem tamamlandı!")
    case "hata":
        print("Bir hata oluştu!")
    case _:
        print("Bilinmeyen case")
end

String Operations (UTF-8)

let mesaj = "Merhaba Dünya! 🌍"
let len = len(mesaj)
let birleşik = "Hello " + "World"

Error Management

try
    let dosya = aç("data.txt")
    print(input(dosya))
catch hata
    print("Dosya açılamadı: " + hata)
end

Compiler Architecture

The BERK compiler has a modern structure:

Kaynak Kod (.berk)
    ↓
Lexer (Token Üretimi)
    ↓
Parser (AST Oluşturma)
    ↓
Semantic Analysis (Tip Kontrolü)
    ↓
CFG Analysis (Dataflow Analysis)
    ↓
IR Generation (BERK IR)
    ↓
IR Optimization (O0-O3)
    ↓
LLVM IR Generation
    ↓
Machine Code (.exe/.o)

Project Status

Current Version:v1.0.0
Last Update:18 November 2025
Situation:Active Development

Completed Features ✅

  • Lexer & Parser (100%)
  • Type System (100%)
  • LLVM Backend (100%)
  • CFG Analysis (100%)
  • IR Optimizer (100%)
  • REPL (100%)
  • VS Code Extension (100%)

Ongoing Studies

  • Runtime Library
  • Standard Library
  • PackageManager
  • Debugger Integration

For detailed road maproad mapsee page.

Community and Contribution

BERK is an open source project and contributions are welcome!

Additional Resources


Are you ready? SetupLet's start from the section!