A statically-typed systems language with modern syntax that transpiles to C++
✅ ALPHA v0.8.19 - Stack Overflow Protection (BUG #300 fixed) ✅
Quick Start • Language Spec • Advanced Features • Design Patterns • Examples
L++ introduces the revolutionary autopattern keyword that intelligently generates complete implementations of all 23 Gang of Four design patterns!
// ONE LINE = COMPLETE PATTERN IMPLEMENTATION!
autopattern Singleton ConfigManager;
autopattern Factory ShapeFactory;
autopattern Observer EventBus;
✨ Features:
- 🎯 Intelligent Detection — Keyword-based pattern recognition
- 🚀 Zero Boilerplate — Complete pattern in one line
- 📚 All 23 GoF Patterns — Creational, Structural, Behavioral
- 🔧 Smart Defaults — Pattern-specific methods and properties
- 💡 Type Safe — Full C++ type system integration
→ See Complete Pattern Catalog
- 🎯 Modern Syntax — Rust/JS-inspired (arrow functions, destructuring, spread)
- 🎨 Multi-Paradigm — HYBRID, FUNCTIONAL, IMPERATIVE, OOP, GOLFED (5 paradigms!)
- 📦 ES6+ Support — Optional chaining (
?.), nullish coalescing (??), template literals - ⚡ Golf-Style Operators — Symbolic functional programming (
~,@,?,\) - 🔁 Iterate-While — Haskell-inspired sequence generation (
!!<,!!>,!! $,~>) - 🎭 Paradigm Enforcement — Per-file paradigm declaration with validation
- 🔧 Pattern Matching —
matchexpressions with guards - 🧩 ADTs — Algebraic data types and type unions
- 🎨 Higher-Order Functions — Map, filter, compose, pipeline operator
- 🔗 Interfaces & Traits — Protocol-oriented programming
- 📝 List Comprehensions — Python-style syntax
- 🌊 Lambda Expressions — Closures with capture
- 🎁 Generators —
yieldkeyword for lazy evaluation - 🔍 Type Guards —
typeof,instanceofoperators - 📊 Getters/Setters — Property accessors with
get/set - ⬅️ Arrow-Left Returns — Alternative return syntax (
<-)
- 🛡️ Path-Sensitive Analysis — CFG + data-flow tracking
- ✅ Paradigm Validation — Enforce functional purity, OOP, or imperative style
- 🔍 Division by Zero — Compile-time detection
⚠️ Uninitialized Variables — Catch bugs before runtime- 💀 Dead Code Detection — Find unreachable code
- 🚫 Null Dereference — Safety checks (45/45 critical bugs fixed ✅)
- 💧 Memory Leak Detection — Track allocations
- 🔢 Integer Overflow — Warnings for potential overflows
- ✅ Memory Safe Patterns — Smart pointers in all design patterns
- ✅ Command Injection Prevention — Path validation & shell escaping
- ✅ Bounds Checking — 80+ array access validations
- ✅ NULL Safety — nullptr checks after dynamic_cast
- ✅ Virtual Destructors — Prevent undefined behavior
- ✅ Thread-Safe Singleton — std::call_once implementation
- 🔍 Path Finding — BFS-based path existence check
- 🛤️ Shortest Path — Unweighted graph traversal
- 🌐 Connected Components — Count graph components
- 🎨 Bipartite Check — 2-colorability detection
- 🔧 VS Code Extension — Syntax highlighting + real-time errors
- 📖 Problem Matcher — Errors shown directly in editor
- 🚀 Fast Compilation — Transpiles to C++ then native code
- ⚡ High Performance — Optimized C++ output
- Quick Start Guide - Get started in 5 minutes
- Language Specification - Complete language reference
- Advanced Features - ES6+, golf operators, generators, quantum
- Design Patterns - 23 GoF patterns with autopattern
- Paradigms Guide - Multi-paradigm programming
- Bug Fixes History - All 45 bugs fixed in v0.8.17
- Changelog - Version history and releases
See docs/README.md for complete documentation with topic index.
lpp/
├── src/ # Compiler source code
├── include/ # Header files
├── stdlib/ # Standard library
├── examples/ # Sample programs
├── tests/ # Test suite
├── docs/ # 📚 Complete documentation
│ ├── QUICKSTART.md # Getting started
│ ├── FULL_SPEC.md # Language reference
│ ├── ADVANCED_FEATURES.md # Modern features
│ ├── DESIGN_PATTERNS.md # Pattern catalog
│ ├── PARADIGMS.md # Programming styles
│ ├── BUG_FIXES.md # Bug fix history (45 bugs fixed)
│ └── README.md # Documentation index
├── vscode-extension/ # VS Code integration
├── CHANGELOG.md # Version history
└── README.md # This file
Download a release or build from source:
git clone https://github.com/alb0084/lpp.git
cd lpp
cmake -B build
cmake --build build --config ReleaseCompiler output:
- Windows →
build/Release/lppc.exe - Unix →
build/lppc
Create hello.lpp:
fn main() -> int {
println("Hello, LPP!");
return 0;
}
Compile & run:
lppc hello.lpp
./hellolet x = 42; // immutable by default
let mut counter = 0; // mutable
counter = counter + 1;
let name: string = "LPP"; // explicit types
let pi: float = 3.14159;
fn add(a: int, b: int) -> int {
return a + b;
}
let multiply = (x, y) => x * y; // arrow functions
let squares = numbers.map(|n| n*n);
if (x > 0) {
println("positive");
} else if (x < 0) {
println("negative");
} else {
println("zero");
}
let result = x > 0 ? "positive" : "negative"; // ternary
// Golf-style operators (compact functional programming)
let range = 0~10; // [0,1,2,...,10]
let doubled = nums @ (x -> x * 2); // map
let evens = nums ? (x -> x % 2 == 0); // filter
let sum = nums \ ((acc,x) -> acc+x); // reduce
// Iterate-while (Haskell-inspired sequence generation)
let countdown = 10 !!> 0; // [10,9,8,7,6,5,4,3,2,1]
let powers = 1 !! (x -> x < 100) $ (x -> x*2); // [1,2,4,8,16,32,64]
let squares = 1 ~> (x -> x+1) !! (x -> x < 10) @ (x -> x*x); // [1,4,9,16,25,36,49,64,81]
// Destructuring & spread
let [a, b, ...rest] = array;
let {x, y} = point;
let combined = [...a1, ...a2];
// Optional chaining & nullish coalescing
let city = user?.address?.city;
let username = user?.name ?? "Anon";
LPP includes a built-in analyzer that catches issues before compilation:
fn example() -> int {
let x;
let y = x + 10; // ERROR: uninitialized variable
let z = 10 / 0; // ERROR: division by zero
return 0;
println("unreachable"); // WARNING: dead code
}
- ✅ Division by zero detection
- ✅ Uninitialized variable use
- ✅ Dead code detection
- ✅ Null dereference checks
- ✅ Memory leak detection
- ✅ Integer overflow warnings
LPP uses a multi-stage pipeline:
Source Code (.lpp)
↓
Lexer (Tokenization)
↓
Parser (AST Construction)
↓
Static Analyzer (CFG + Data-Flow)
↓
C++ Transpiler
↓
g++/clang (Native Compilation)
↓
Executable
Details in ARCHITECTURE.md.
- Quick Start
- Language Specification
- Advanced Features — Golf operators, iterate-while, ES6+ features
- Architecture Guide
- Static Analyzer Details
- Design Patterns
- Paradigms Guide
- Bug Fixes History
- Roadmap
- Systems Programming — Low-level performance, modern syntax
- Learning — Great introduction to compilers and type systems
- Rapid Prototyping — Fast C++ generation without memory headaches
- Embedded Development — Efficient binaries for constrained devices
- Fork repository
- Create feature branch
- Commit changes
- Push branch
- Open Pull Request
See the examples/ directory:
- LightJS — The original runtime that inspired LPP
MIT License — see LICENSE.
- Clang Static Analyzer for CFG-based analysis approach
- JavaScript/TypeScript for syntax inspiration
- Rust for modern language design principles
Built with ❤️ for modern systems programming