Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

1,039 Commits

Repository files navigation

ProXPL - ProX Programming Language

A Modern, High-Performance Programming Language

License: MITProXPL CIVersionPlatform

Clean Syntax • Static Typing • Stack-Based VM • C-Level Performance

Quick StartInstallationDocumentationArchitectureContributing


📖 Introduction

ProXPL (ProX Programming Language) is a modern, statically-typed multi-paradigm systems programming language that seamlessly integrates Object-Oriented, Intent-Oriented, and Context-Oriented features for clarity, performance, and reliability. Born from a vision to combine Python's readability with C's execution speed, ProXPL features a professional compiler architecture, a custom stack-based bytecode VM, a robust static type system, and an integrated package manager (PRM).

ProXPL is implemented entirely in C/C++ with zero runtime dependencies, making it ideal for high-performance systems, embedded applications, game development, and backend services. It serves as an excellent reference for learning compiler design and interpreter implementation.

Why ProXPL?

  • 🎯 Familiar Syntax: Clean, expressive syntax inspired by JavaScript and Python
  • ⚡ True Performance: Bytecode compilation to a stack-based VM with LLVM backend for AOT compilation
  • 🛡️ Type Safety: Static typing with intelligent type inference prevents entire classes of runtime errors
  • 🔧 Batteries Included: 75+ built-in standard library functions covering I/O, math, strings, collections, and system operations
  • 📦 Integrated Tooling: Built-in package manager (PRM), CLI tools, and LSP support
  • 🏗️ Professional Architecture: Clean separation between lexer, parser, type checker, compiler, and VM

✨ Key Features

FeatureDescription
🔤 Modern SyntaxJavaScript-like syntax with curly braces, familiar control flow, and clean function definitions
🎨 ProXPL Icons1100+ File Icons support via the official extension (Material Icon Theme integration)
Fast ExecutionCustom stack-based VM executing optimized bytecode with LLVM AOT compilation support
📦 Rich Standard Library75+ native functions for I/O, mathematics, string manipulation, collections, and system tasks
🛡️ Static Type SystemCompile-time type checking with type inference reduces runtime errors
🧩 Module SystemRobust use keyword for importing standard libraries, packages, and local files
🔧 PRM Package ManagerIntegrated ProX Repository Manager for dependency management and project scaffolding
🏗️ Multi-Phase CompilerLexer → Parser (AST) → Type Checker → IR Optimizer → Bytecode/LLVM
Async/AwaitNative asynchronous programming with LLVM Coroutines support
🔄 Multi-ParadigmNative support for Object-Oriented, Intent-Oriented, and Context-Oriented programming
🔍 Developer ToolsCLI with watch mode, LSP for IDE integration, comprehensive error reporting
🎯 Memory SafetyBuilt-in garbage collector with mark-and-sweep algorithm
🌐 Cross-PlatformFirst-class support for Windows, Linux, and macOS

🏛️ The 10 Operational Pillars (v1.3.0)

ProXPL introduces 10 revolutionary concepts that redefine modern systems programming:

  1. Intent-Oriented Programming: Define what you want (intent), not just how to do it (resolver).
  2. Context-Aware Polymorphism: Adapt function behavior dynamically based on execution context (context, layer, activate).
  3. Autonomic Self-Healing (ASR): Built-in failure recovery with resilient and recovery blocks.
  4. Intrinsic Security: Taint analysis and sanitize() primitives baked into the type system.
  5. Chrono-Native Logic: Data with expiration dates (temporal, decay after).
  6. Event-Driven Concurrency: Distributed nodes and types (distributed, node) as first-class citizens.
  7. AI-Native Integration: Define, train, and run ML models (model, train, predict) natively.
  8. Quantum-Ready Syntax: Future-proof syntax for quantum operations (quantum, superpose, entangle).
  9. Hardware-Accelerated Math: GPU kernel offloading (gpu, kernel) and tensor math.
  10. Zero-Trust Security: Mandatory identity verification blocks (verify identity) and crypto primitives.

⚡ Quick Start

Your First Program

Create a file named hello.prox:

// hello.prox// Your first ProXPL programfuncmain(){print("Welcome to ProXPL!");letname=input("What is your name? ");print("Hello, "+name+"!");// Generate a random lucky numberletlucky=random(1,100);print("Here is a lucky number for you: "+to_string(lucky));}main();

Run It

Using the ProXPL CLI:

prm run hello.prox

Or using the compiled executable:

./proxpl hello.prox

Output

Welcome to ProXPL!
What is your name? Alice
Hello, Alice!
Here is a lucky number for you: 42

📥 Installation

Option 1: Pre-built Binaries (Recommended)

Download the latest release for your operating system:

Add the executable to your system PATH for global access.

Option 2: Build from Source

Requirements:

  • C/C++ Compiler (GCC 9+, Clang 10+, or MSVC 2019+)
  • CMake 3.15+
  • LLVM 10+ (for AOT compilation support)
  • Git

Build Instructions:

# Clone the repository
git clone https://github.com/ProgrammerKR/ProXPL.git
cd ProXPL
# Create build directory
mkdir build &&cd build
# Configure with CMake
cmake -DCMAKE_BUILD_TYPE=Release ..
# Build the project
make
# Optional: Install system-wide
sudo make install

Windows (Visual Studio):

mkdir build &&cd build
cmake -G "Visual Studio 16 2019" ..
cmake --build . --config Release

Option 3: CLI via Node.js (Enhanced Developer Experience)

The ProXPL CLI provides watch mode, better logging, and development conveniences:

cd src/cli
npm install
npm link

Now use the prox command globally with enhanced features.


💻 Language Tour

Variables & Data Types

ProXPL supports 12 core data types with static type checking:

// Primitivesletcount=42;// Integerletprice=19.99;// Floatletactive=true;// Booleanletmessage="Hello!";// String// Collectionsletnumbers=[1,2,3,4,5];// Listletconfig={"host": "localhost","port": 8080};// Dictionary// Type inference works automaticallyletauto=100;// Inferred as Integer

Functions & Control Flow

// Function definitionfuncfibonacci(n){if(n<=1)returnn;returnfibonacci(n-1)+fibonacci(n-2);}// Loops and iterationfuncmain(){for(leti=0;i<10;i=i+1){print("fib("+to_string(i)+") = "+to_string(fibonacci(i)));}// While loopsletcount=0;while(count<5){print("Count: "+to_string(count));count=count+1;}}main();

Working with Collections

funcdemonstrate_collections(){// Listsletitems=[1,2,3];push(items,4);// Add elementletfirst=items[0];// Access by indexletsize=length(items);// Get size// Dictionariesletuser={"name": "Alice","age": 30};user["email"]="alice@example.com";// Add keyletname=user["name"];// Access value// Iterationfor(leti=0;i<length(items);i=i+1){print(to_string(items[i]));}}

Tensor Operations (AI/Math)

ProXPL supports native tensor operations for AI and scientific computing:

functensor_demo(){// Define tensors using nested bracket syntaxletmatrix=[[1,2],[3,4]];letidentity=[[1,0],[0,1]];// Matrix multiplication using @ operatorletresult=matrix @ identity;print(result);// <tensor 2x2>// Dot product for 1D tensorsletv1=[1,2,3];letv2=[4,5,6];letdot=v1 @ v2;print(dot);// 32}

Module System

ProXPL uses the use keyword for modular programming:

// Import standard library moduleusestd.math;// Import from installed packageusehttp.client;// Import local file (relative path)uselocal_helper;funcmain(){letresult=std.math.sqrt(16);print("Square root of 16: "+to_string(result));}

Async/Await

ProXPL supports native asynchronous programming:

asyncfuncfetchUser(id){// Simulate non-blocking operationreturn{"id": id,"name": "User"+to_string(id)};}asyncfuncmain(){print("Fetching user...");letuser=awaitfetchUser(42);print("Got user: "+user["name"]);}

Standard Library Examples

usestd.io;usestd.fs;usestd.sys;funcshowcase_stdlib(){// File I/Oletcontent=read_file("data.txt");write_file("output.txt","Hello from ProXPL!");// String operationslettext="ProXPL is awesome";letupper=to_upper(text);letparts=split(text," ");// Math operationsletresult=sqrt(144);letpower=pow(2,8);letrandom_num=random(1,100);// System operationsletenv_var=env("PATH");letcurrent_time=time();}

Foreign Function Interface (FFI)

ProXPL can invoke native C functions from dynamic libraries (.dll, .so) using the extern keyword.

// Load C standard libraryextern"msvcrt.dll""puts"funcc_puts(text);extern"msvcrt.dll""abs"funcc_abs(n);c_puts("Hello from C!");letdist=c_abs(-100);

📦 Package Manager (PRM)

ProXPL includes PRM (ProX Repository Manager), a built-in package manager for dependency management and project scaffolding.

Basic Commands

# Initialize a new project
prm init my-project
# Install a package
prm install http-server
# List installed packages
prm list
# Search for packages
prm search json
# Update dependencies
prm update
# Remove a package
prm remove old-package

Project Structure (project.pxcf)

// project.pxcfproject{
name: "my-web-server"
version: "1.1.0"
author: "Your Name <you@example.com>"
license: "MIT"}compiler{
optimize: true
debug: false
target: "native"}paths{
src: "./src"
build: "./build"
entry: "src/main.prox"}dependencies{
http: "1.3.0"
json: "1.1.0"}runtime{
threads: 8
memory_limit: "1GB"}

🏗️ Architecture Overview

ProXPL follows a professional multi-phase compiler architecture designed for maintainability, extensibility, and performance.

graph LR
A[Source Code .prox] --> B[Scanner/Lexer]
B --> C[Parser]
C --> D[AST]
D --> E[Type Checker]
E --> F[IR Generator]
F --> G[SSA Optimizer]
G --> H{Compilation Mode}
H -->|Bytecode| I[Bytecode Generator]
H -->|AOT| J[LLVM Backend]
I --> K[Bytecode Chunk]
J --> L[Native Binary]
K --> M[Stack-Based VM]
L --> N[Direct Execution]
M --> O[Runtime Execution]
N --> O
Loading

Core Components

ComponentLocationResponsibility
Scanner/Lexersrc/lexer/scanner.cTokenizes source code into lexical tokens
Parsersrc/parser/parser.cBuilds Abstract Syntax Tree (AST) from tokens
Type Checkersrc/compiler/type_checker.cValidates types and enforces type safety
IR Generatorsrc/compiler/ir_gen.cGenerates intermediate representation (SSA form)
IR Optimizersrc/compiler/ir_opt.cPerforms optimizations on SSA IR
Bytecode Compilersrc/compiler/bytecode_gen.cEmits optimized bytecode instructions
LLVM Backendsrc/compiler/backend_llvm.cppGenerates LLVM IR for AOT native compilation
Virtual Machinesrc/runtime/vm.cStack-based VM that executes bytecode
Garbage Collectorsrc/runtime/gc.cMark-and-sweep GC for automatic memory management
Memory Managersrc/runtime/memory.cLow-level memory allocation and tracking
Standard Librarysrc/stdlib/Native implementations of 75+ built-in functions

Compilation Pipeline

  1. Lexical Analysis: Source code is tokenized into meaningful symbols
  2. Syntax Analysis: Tokens are parsed into an Abstract Syntax Tree
  3. Semantic Analysis: Type checking and semantic validation
  4. IR Generation: AST is lowered to SSA-based intermediate representation
  5. Optimization: IR optimizations (constant folding, dead code elimination, etc.)
  6. Code Generation:
    • Bytecode Path: Generate bytecode for VM execution
    • Native Path: Generate LLVM IR → native binary via LLVM
  7. Execution: Run on the stack-based VM or execute native binary

📂 Project Structure

ProXPL/
├── assets/ # Project assets (icons, logos)
├── benchmarks/ # Performance benchmarking suite
├── docs/ # Comprehensive documentation
│ ├── architecture/ # Architecture guides
│ ├── pillars/ # Core paradigm specifications
│ └── releases/ # Version release notes
├── examples/ # Example programs
│ ├── advanced/ # Advanced integrations
│ ├── algorithms/ # Algorithm examples
│ ├── basics/ # Basic scripts
│ └── ui_and_web/ # UI and web frameworks
├── extension/ # VS Code Extension source
├── include/ # Public C/C++ header files
│ ├── ast.h # AST node definitions
│ ├── compiler.h # Compiler interface
│ ├── gc.h # Garbage collector interface
│ └── vm.h # Virtual machine interface
├── runtime/ # ASR (Autonomic Self-Healing) C++ runtime
├── scripts/ # Build and utility scripts
├── src/ # Compiler and VM source code
│ ├── cli/ # Command-line interface tools
│ ├── compiler/ # Multi-phase compiler implementation
│ ├── prm/ # ProX Repository Manager
│ ├── runtime/ # VM runtime execution core
│ ├── stdlib/ # Native standard library functions
│ └── vm/ # Virtual machine and dispatch
├── std/ # ProXPL standard library modules
├── tests/ # Comprehensive test suite
│ ├── benchmarks/ # Script benchmarks
│ ├── integration/ # E2E integration tests
│ ├── iop/ # Intent, Context, and ASR tests
│ ├── language/ # Core language feature tests
│ └── vm/ # C/C++ runtime unit tests
├── tools/ # Development tools
│ ├── bench/ # Benchmarking tools
│ └── lsp/ # Language Server Protocol
├── CMakeLists.txt # Build configuration
├── Makefile # Alternative build system
└── README.md # This file

📚 Documentation

Comprehensive documentation is available in the docs/ directory:

  • Language Specification: A detailed guide to ProXPL grammar, keywords, operators, data types, and core semantics.
  • Standard Library Reference: Detailed documentation for all built-in functions and modules.
  • Architecture Guide: A deep dive into the compiler design and Virtual Machine (VM) internals.
  • Core Pillars: Detailed specifications for ProXPL's 10 paradigm pillars, including Intents, Contexts, and ASR.
  • IR Specification: Documentation for the SSA (Static Single Assignment) intermediate representation.
  • Build Guide: Platform-specific instructions for building ProXPL from source.
  • Coding Standards: Code style guidelines and contribution workflow.
  • Benchmarks: Performance metrics, comparisons, and optimization notes.
  • Ecosystem Design: Overview of the Standard Library and PRM (ProX Package Manager) architecture.


🧪 Testing

Run the comprehensive test suite:

# Build with tests enabled
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON ..
make
# Run all tests
make test# Run specific test
./build/tests/lexer_test
./build/tests/parser_test
./build/tests/vm_test

🚀 Performance

ProXPL is designed for high performance through multiple optimization layers:

  • Zero-cost abstractions: High-level features compile to efficient low-level code
  • SSA-based optimizations: Constant folding, dead code elimination, common subexpression elimination
  • Bytecode JIT potential: Foundation for future JIT compilation
  • LLVM backend: Leverages industry-standard optimizer for native performance
  • Efficient GC: Mark-and-sweep with tri-color marking (planned)

See BENCHMARKS.md for detailed performance comparisons.


🗺️ Roadmap

  • v0.5.0 (Alpha): Core language features (variables, functions, control flow). ✅

  • v0.8.0: Advanced memory management, closures, upvalues. ✅

  • v0.9.0: Standard Library (fs, time, gc), IO improvements. ✅

  • v1.0.0:

    • Object-Oriented Programming: Classes, Methods, Inheritance, Properties. ✅
    • Keywords: class, new, this, extends, interface. ✅
    • Runtime: Optimized VM with Object Support. ✅
  • v1.6.2 (Current):

    • Intent-Oriented Programming: Full VM support for intent and resolver dynamic dispatch. ✅
    • Context-Aware Polymorphism: Dynamic behavioral overrides via context, layer, and activate. ✅
    • Autonomic Self-Healing (ASR): Zero-cost stack unwinding through resilient exception blocks. ✅
    • Performance Tooling: Benchmark suite for core abstractions. ✅

Future Roadmap (2026–2028)

  • 📋 v1.7.0 — ProX Studio Alpha, PRM Registry, Testing Framework, Macros.
  • 📋 v1.8.0 — WebAssembly Target, String Templates, Operator Overloading, Formatter.
  • 📋 v1.9.0 — Channels, Actors, Database Connectivity, LSP v2, Compile-Time Eval.
  • 📋 v1.9.5 — Cross-Compilation, Embedded API, Security Hardening, API Freeze.
  • 🚀 v2.0.0 — Self-Hosting Compiler, JIT Compiler, Effect System, Production Stable.

📝 Recent Changes (v1.6.2)

  • IOP Core: Fully implemented intent, resolver, and satisfies with native VM dispatch.
  • Context-Aware Polymorphism: Fully implemented context, layer, and activate.
  • Autonomic Self-Healing (ASR): Added resilient exception recovery blocks without corrupting state.
  • Performance Benchmarks: New benchmark suite for dynamic dispatch paradigms.
  • ASR Refinement: Zero-cost stack unwinding for resilient blocks using ExceptionHandlerTable.
  • LLVM Backend: LLVM PassManager configured for O3 (Vectorization and Inlining) and Tail-Call Optimization (TCO).
  • See the full CHANGELOG.md for more details.

🛠️ Contributing

We warmly welcome contributions! ProXPL is an excellent project for learning compiler design, language implementation, and systems programming.

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Follow the Coding Standards
  4. Write tests for new features
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Areas for Contribution

  • 🐛 Bug fixes and stability improvements
  • ✨ New standard library functions
  • 📝 Documentation and tutorials
  • 🧪 Test coverage expansion
  • ⚡ Performance optimizations
  • 🎨 IDE and editor plugins
  • 📦 Community packages

Please read CONTRIBUTING.md for detailed guidelines and CODE_OF_CONDUCT.md for community standards.


📄 License

This project is licensed under the ProXPL Professional License - see the LICENSE file for details.


Built with ❤️ by the ProXPL Community
Making programming easy, accessible and enjoyable

ProXPL - A Modern Programming Language for the Future

About

ProX Programming Language (ProXPL) is a modern, Indian-origin programming language designed for speed, simplicity, and professional-grade development. It combines Python-like readability with C-level performance, focusing on clean syntax, scalable systems, and a growing native ecosystem.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

15 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages