Getting Started with YaarScript
Welcome to YaarScript - an industrial-grade compiler with Urdu-inspired syntax that makes programming accessible and intuitive.
What is YaarScript?
YaarScript is a slang-infused Urdu styled programming language that turns regular code into cool slang. It is a professional, close to industrial-grade programming language that brings the warmth and familiarity of the Urdu language to modern coding. Built with Rust and compiled to WebAssembly, it offers blazing-fast performance while maintaining an intuitive, culturally-resonant syntax.
Whether you're a beginner learning programming concepts in your native linguistic context, or an experienced developer building production applications, YaarScript provides the tools and features you need.
🎯 Design Philosophy
Cultural Accessibility
Keywords inspired by Urdu/Hindi make programming intuitive for South Asian developers.
Industrial Strength
Multi-pass compiler with optimization, type safety, and production-ready features.
Modern Tooling
Web-based IDE with syntax highlighting, instant compilation, and zero setup required.
Zero Dependencies
Runs entirely in the browser via WebAssembly - no server required.
✨ Key Features
- WebAssembly Powered - Entire compiler compiled to wasm32-unknown-unknown for native browser performance
- Urdu-Inspired Keywords - Natural, intuitive syntax using familiar words like
agar,warna,dohrao - Multi-Pass Optimizer - Fixed-point optimization with constant folding, dead code elimination, and peephole optimization
- Strong Type System - Strict typing with no implicit coercion ensures code safety and reliability
- Modern IDE Experience - Professional editor with syntax highlighting, auto-completion, and real-time error detection
- Three-Address Code - Generates optimized intermediate representation for efficient execution
- Rich Data Types - Support for integers, floats, doubles, characters, strings, and booleans
- Control Flow Mastery - Complete set of control structures including loops, conditionals, and switch statements
🏗️ Compiler Architecture
YaarScript features a sophisticated multi-stage compilation pipeline:
- Lexical Analysis (Scanner) - Tokenizes source code with full Unicode support, handling Urdu keywords and special characters
- Syntax Analysis (Parser) - Top-Down Operator Precedence (Pratt) Parser builds an Abstract Syntax Tree (AST) with proper operator precedence
- Semantic Analysis - Comprehensive scope management, symbol table construction, and type checking with detailed error reporting
- IR Generation - Generates Three-Address Code (TAC), a low-level intermediate representation optimized for analysis
- Optimization Passes - Fixed-point optimization including constant folding, common subexpression elimination, and dead code removal
- Execution Engine - High-performance virtual machine executes optimized TAC with runtime type safety
🎓 Who is YaarScript For?
- Students & Beginners - Learn programming concepts in a linguistically familiar environment
- Educators - Teach computer science using culturally relevant syntax that resonates with students
- Hobbyists - Experiment with compiler design and language implementation
- Developers - Build tools and applications with a unique, expressive language
- Researchers - Study programming language design with focus on cultural adaptation
🚀 Quick Example
Here's a taste of YaarScript's intuitive syntax:
// Your first YaarScript program yaar { // Variables with Urdu-inspired types lafz greeting = "Assalam-o-Alaikum"; number count = 10; faisla isActive = sahi; // Print output bolo(greeting, " from YaarScript!\n"); bolo("Count: ", count, "\n"); // Conditional logic agar (isActive) { bolo("System is active!\n"); } warna { bolo("System inactive.\n"); } // Loops made simple dohrao (number i = 1; i <= 5; i++) { bolo("Iteration #", i, "\n"); } }
📚 What You'll Learn
This documentation covers everything you need to master YaarScript:
- Complete language syntax and semantics
- Type system and variable declarations
- Functions, control flow, and loops
- Advanced features like enums and constants
- Best practices and coding patterns
- Real-world examples and use cases
💡 Pro Tip
Start with the Quick Start section to write your first program, then explore Variables & Types to understand the type system. Use the online playground to experiment as you learn!