Skip to content

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.

License

Notifications You must be signed in to change notification settings

ProgrammerKR/ProXPL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

ProXPL - ProX Programming Language

A Modern, High-Performance Programming Language

License: MIT ProXPL CI Version Platform

Clean Syntax β€’ Static Typing β€’ Stack-Based VM β€’ C-Level Performance

Quick Start β€’ Installation β€’ Documentation β€’ Architecture β€’ Contributing


πŸ“– Introduction

ProXPL (ProX Programming Language) is a modern, statically-typed systems programming language designed 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

Feature Description
πŸ”€ Modern Syntax JavaScript-like syntax with curly braces, familiar control flow, and clean function definitions
🎨 ProXPL Icons 1100+ File Icons support via the official extension (Material Icon Theme integration)
⚑ Fast Execution Custom stack-based VM executing optimized bytecode with LLVM AOT compilation support
πŸ“¦ Rich Standard Library 75+ native functions for I/O, mathematics, string manipulation, collections, and system tasks
πŸ›‘οΈ Static Type System Compile-time type checking with type inference reduces runtime errors
🧩 Module System Robust use keyword for importing standard libraries, packages, and local files
πŸ”§ PRM Package Manager Integrated ProX Repository Manager for dependency management and project scaffolding
πŸ—οΈ Multi-Phase Compiler Lexer β†’ Parser (AST) β†’ Type Checker β†’ IR Optimizer β†’ Bytecode/LLVM
⏩ Async/Await Native asynchronous programming with LLVM Coroutines support
πŸ” Developer Tools CLI with watch mode, LSP for IDE integration, comprehensive error reporting
🎯 Memory Safety Built-in garbage collector with mark-and-sweep algorithm
🌐 Cross-Platform First-class support for Windows, Linux, and macOS

πŸ›οΈ The 10 Operational Pillars (v1.2.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).
  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 program

func main() {
    print("Welcome to ProXPL!");
    
    let name = input("What is your name? ");
    print("Hello, " + name + "!");
    
    // Generate a random lucky number
    let lucky = random(1, 100);
    print("Here is a lucky number for you: " + to_string(lucky));
}

main();

Run It

Using the ProXPL CLI:

prox 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:

// Primitives
let count = 42;              // Integer
let price = 19.99;           // Float
let active = true;           // Boolean
let message = "Hello!";      // String

// Collections
let numbers = [1, 2, 3, 4, 5];                    // List
let config = {"host": "localhost", "port": 8080}; // Dictionary

// Type inference works automatically
let auto = 100;  // Inferred as Integer

Functions & Control Flow

// Function definition
func fibonacci(n) {
    if (n <= 1) return n;
    return fibonacci(n - 1) + fibonacci(n - 2);
}

// Loops and iteration
func main() {
    for (let i = 0; i < 10; i = i + 1) {
        print("fib(" + to_string(i) + ") = " + to_string(fibonacci(i)));
    }
    
    // While loops
    let count = 0;
    while (count < 5) {
        print("Count: " + to_string(count));
        count = count + 1;
    }
}

main();

Working with Collections

func demonstrate_collections() {
    // Lists
    let items = [1, 2, 3];
    push(items, 4);           // Add element
    let first = items[0];     // Access by index
    let size = length(items); // Get size
    
    // Dictionaries
    let user = {"name": "Alice", "age": 30};
    user["email"] = "alice@example.com";  // Add key
    let name = user["name"];              // Access value
    
    // Iteration
    for (let i = 0; i < length(items); i = i + 1) {
        print(to_string(items[i]));
    }
}

Module System

ProXPL uses the use keyword for modular programming:

// Import standard library module
use std.math;

// Import from installed package
use http.client;

// Import local file (relative path)
use local_helper;

func main() {
    let result = std.math.sqrt(16);

    print("Square root of 16: " + to_string(result));
}

Async/Await

ProXPL supports native asynchronous programming:

async func fetchUser(id) {
    // Simulate non-blocking operation
    return {"id": id, "name": "User" + to_string(id)};
}

async func main() {
    print("Fetching user...");
    let user = await fetchUser(42);
    print("Got user: " + user["name"]);
}

Standard Library Examples

use std.io;
use std.fs;
use std.sys;

func showcase_stdlib() {
    // File I/O
    let content = read_file("data.txt");
    write_file("output.txt", "Hello from ProXPL!");
    
    // String operations
    let text = "ProXPL is awesome";
    let upper = to_upper(text);
    let parts = split(text, " ");
    
    // Math operations
    let result = sqrt(144);
    let power = pow(2, 8);
    let random_num = random(1, 100);
    
    // System operations
    let env_var = env("PATH");
    let current_time = time();
}

Foreign Function Interface (FFI)

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

// Load C standard library
extern "msvcrt.dll" "puts" func c_puts(text);
extern "msvcrt.dll" "abs" func c_abs(n);

c_puts("Hello from C!");
let dist = 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 (prox.toml)

[package]
name = "my-web-server"
version = "1.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2025"
description = "A fast web server built with ProXPL"
license = "MIT"

[dependencies]
http_parser = "2.1.0"
json = "1.5.0"

[build]
target = "native"
optimize = true

πŸ—οΈ 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

Component Location Responsibility
Scanner/Lexer src/lexer/scanner.c Tokenizes source code into lexical tokens
Parser src/parser/parser.c Builds Abstract Syntax Tree (AST) from tokens
Type Checker src/compiler/type_checker.c Validates types and enforces type safety
IR Generator src/compiler/ir_gen.c Generates intermediate representation (SSA form)
IR Optimizer src/compiler/ir_opt.c Performs optimizations on SSA IR
Bytecode Compiler src/compiler/bytecode_gen.c Emits optimized bytecode instructions
LLVM Backend src/compiler/backend_llvm.cpp Generates LLVM IR for AOT native compilation
Virtual Machine src/runtime/vm.c Stack-based VM that executes bytecode
Garbage Collector src/runtime/gc.c Mark-and-sweep GC for automatic memory management
Memory Manager src/runtime/memory.c Low-level memory allocation and tracking
Standard Library src/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/
β”œβ”€β”€ include/                  # Public header files
β”‚   β”œβ”€β”€ vm.h                  # Virtual machine interface
β”‚   β”œβ”€β”€ compiler.h            # Compiler interface
β”‚   β”œβ”€β”€ ast.h                 # AST node definitions
β”‚   β”œβ”€β”€ stdlib_native.h       # Standard library declarations
β”‚   └── gc.h                  # Garbage collector interface
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.c                # Entry point
β”‚   β”œβ”€β”€ lexer/                # Lexical analysis
β”‚   β”‚   └── scanner.c
β”‚   β”œβ”€β”€ parser/               # Syntax analysis
β”‚   β”‚   β”œβ”€β”€ parser.c
β”‚   β”‚   └── ast.c
β”‚   β”œβ”€β”€ compiler/             # Code generation
β”‚   β”‚   β”œβ”€β”€ type_checker.c
β”‚   β”‚   β”œβ”€β”€ ir_gen.c
β”‚   β”‚   β”œβ”€β”€ ir_opt.c
β”‚   β”‚   β”œβ”€β”€ bytecode_gen.c
β”‚   β”‚   └── backend_llvm.cpp
β”‚   β”œβ”€β”€ runtime/              # Runtime system
β”‚   β”‚   β”œβ”€β”€ vm.c              # Virtual machine
β”‚   β”‚   β”œβ”€β”€ gc.c              # Garbage collector
β”‚   β”‚   β”œβ”€β”€ memory.c          # Memory management
β”‚   β”‚   β”œβ”€β”€ chunk.c           # Bytecode storage
β”‚   β”‚   └── object.c          # Runtime object system
β”‚   β”œβ”€β”€ stdlib/               # Standard library (native)
β”‚   β”‚   β”œβ”€β”€ stdlib_core.c
β”‚   β”‚   β”œβ”€β”€ stdlib_io.c
β”‚   β”‚   β”œβ”€β”€ stdlib_math.c
β”‚   β”‚   └── stdlib_string.c
β”‚   β”œβ”€β”€ prm/                  # Package manager
β”‚   β”‚   β”œβ”€β”€ manifest.c
β”‚   β”‚   └── builder.c
β”‚   └── utils/                # Utilities
β”‚       └── error_report.c
β”œβ”€β”€ lib/std/                  # Standard library (ProXPL)
β”œβ”€β”€ tools/
β”‚   β”œβ”€β”€ lsp/                  # Language Server Protocol
β”‚   β”œβ”€β”€ bench/                # Benchmarking tools
β”‚   └── prm_main.c            # PRM CLI entry
β”œβ”€β”€ examples/                 # Example programs
β”œβ”€β”€ tests/                    # Test suite
β”œβ”€β”€ docs/                     # Documentation
β”‚   β”œβ”€β”€ language-spec/        # Language specification
β”‚   β”œβ”€β”€ stdlib/               # Standard library docs
β”‚   └── architecture/         # Architecture guides
β”œβ”€β”€ benchmarks/               # Performance benchmarks
β”œβ”€β”€ 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.
  • 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 (Current):
    • Object-Oriented Programming: Classes, Methods, Inheritance, Properties. βœ…
    • Keywords: class, new, this, extends, interface. βœ…
    • Runtime: Optimized VM with Object Support. βœ…
  • v1.2.0 (Current):
    • The 10 Operational Pillars: Full frontend implementation of Intent-Oriented, Context-Aware, ASR, Intrinsic Security, Chrono-Native, Event-Concurreny, AI-Native, Quantum-Ready, Hardware-Math, and Zero-Trust features. βœ…
    • Frontend Feature Complete: Lexer, Parser, AST, and Type Checker support all 10 pillars. βœ…

v1.2.0 (Current)

Status: Released (Frontend)

  • βœ… 10 Pillars Implementation: Correctly parsing and semantically validating all revolutionary syntax constructs.
  • βœ… AI & Quantum: model, train, quantum, qubit primitives.
  • βœ… Security: policy, tainted, encrypt, verify support.
  • βœ… Distributed: distributed type, node declarations.

v1.1.0

Status: Released

  • βœ… Class-based OOP: First-class support for Classes, Objects, Inheritance, and Interfaces.
  • βœ… Runtime Architecture: Enhanced VM with Class, Instance, and BoundMethod support.
  • βœ… New Keywords: class, new, this, extends, interface, static.
  • βœ… Inheritance: Single inheritance model with superclass method lookup.
  • βœ… Access Control: pub/priv visibility enforcement.
  • βœ… Constructors: init constructor method.
  • βœ… Exception Handling: try/catch blocks.
  • βœ… Verification: Verified via tests/oop_v1.0.0.prox.

Future Roadmap (2026+)

  • πŸ“‹ v1.2.0: FFI Stability & ProX Studio Alpha.
  • πŸ“‹ v1.3.0: Pattern Matching, Enums, Generics.
  • πŸ“‹ v2.0.0: Async/Await, WebAssembly, JIT.

πŸ› οΈ 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

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •