npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

caesar-lang

v1.5.1

Published

High-performance interpreted language with easy syntax

Readme

Caesar

Official Website

Build Status Tests Coverage License NPM Package VS Code Extension Version

Caesar is a Python-like programming language with exceptional performance, delivering 2-50x faster execution than Python and competing directly with optimized C++. With Python-like ease of use - simply run caesar file.csr just like python file.py - Caesar combines familiar syntax with professional performance. This project demonstrates the full spectrum of professional language ecosystem development, showcasing modern C++ techniques and complete distribution systems for building production-quality programming language tools.

🚀 Project Overview

Caesar is not just a language specification—it's a complete professional programming language ecosystem with proven performance benefits that includes:

  • Language Design: Python-inspired syntax with competitive C++ performance and up to 50x faster than Python
  • Python-like Ease of Use: Run caesar file.csr exactly like python file.py - zero learning curve!
  • Complete Interpreter: Full expression evaluation, statement execution, and built-in function library
  • Lexical Analysis: Full tokenization with indentation-based parsing
  • Syntax Analysis: Recursive descent parser with comprehensive AST
  • Error Handling: Detailed diagnostics with position tracking and runtime exception system
  • Testing Framework: Comprehensive test suite with 100% pass rate
  • Performance Benchmarks: Comprehensive comparison suite demonstrating superiority over Python and competitiveness with C++
  • Professional Distribution: NPM package ([email protected]) and automated release system
  • Universal Editor Support: Language Server Protocol implementation for all major editors
  • VS Code Integration: Official Marketplace Extension with F5 run commands and play button
  • Windows Integration: Custom file association, icons, and context menu integration
  • Zero-Setup Installation: Automated installation with no manual configuration required

🌐 Official Website & Community

Visit www.caesarlang.com for the complete Caesar experience!

🎯 What's Available Online:

  • 📚 Interactive Documentation: Complete language reference with live examples (coming soon!)
  • 🎮 Online Playground: Try Caesar directly in your browser - no installation needed! (coming soon!)
  • 📦 Download Center: Get the latest releases for all platforms
    • Windows: Full Release Package with installer (available now)
    • macOS: Native builds (coming soon!)
    • Linux: Debian/RPM packages (coming soon!)
  • 🏆 Performance Benchmarks: Live comparisons showing Caesar's 2-50x Python speedup
  • 📖 Learning Resources: Tutorials, best practices, and advanced guides (coming soon!)
  • 🎨 Code Examples: Curated collection of practical Caesar programs (coming soon!)

🤝 Community & Support:

  • 💬 Discord Community: Join our Discord server
  • 🐛 Issue Tracker: Report bugs and request features on GitHub Issues
  • 📧 Contact Maintainer: Reach out through GitHub discussions or issues
  • 🌟 Contribute: Check our Contributing Guide to get involved
  • 📢 Stay Updated: Follow development progress and announcements

🚀 Try Caesar Right Now: (coming soon!)

Don't want to install anything yet? Visit www.caesarlang.com/playground and start coding with Caesar instantly in your browser!


📥 Installation Options

Caesar offers two distinct installation methods designed for different use cases. Choose the method that best fits your needs:

🏆 Option 1: Release PackageRECOMMENDED FOR FULL EXPERIENCE

🎯 The Complete Caesar Experience - Everything Included!

Direct Download: Get the latest version from GitHub Releases or www.caesarlang.com

Full Windows Integration:

  • 🎨 Custom Caesar Icons: Beautiful .csr file icons in Windows Explorer
  • 🖱️ File Association: Double-click .csr files to run with Caesar
  • 📋 Context Menu: Right-click → "Run with Caesar" / "Open in Caesar REPL"
  • 🏷️ File Type Recognition: Windows recognizes .csr as "Caesar Source File"

🔧 Professional Development Tools:

  • 🚀 Auto VS Code Extension: Automatically installs Caesar Language Support if VS Code detected
  • 🧠 Language Server Protocol: Full IDE features (autocomplete, error checking, go-to-definition)
  • 🎯 Syntax Highlighting: Beautiful Caesar code presentation
  • F5 Run Support: Execute Caesar files directly from VS Code

💼 Enterprise-Ready Features:

  • 📦 Standalone Executables: No external dependencies required
  • 🛡️ Professional Installer: PowerShell-based setup with progress indication
  • 📚 Complete Documentation: User guides, examples, and API reference included
  • 🎛️ Windows Registry Integration: Proper system integration

💡 Perfect For:

  • Production Use: Full system integration for daily Caesar development
  • End Users: Complete out-of-the-box experience with all features
  • Educational Settings: Everything needed for teaching and learning
  • Professional Development: Maximum productivity with full tooling

📋 Requirements:

  • Windows 10/11 (64-bit)
  • PowerShell (for automated installation)
  • VS Code (optional, but recommended for best experience)

🔧 Installation Process:

# 1. Download caesar-v1.4.0-windows.zip from GitHub Releases or website
# 2. Extract to desired location (e.g., C:\Caesar)
# 3. Run the automated installer (choose one):
#    PowerShell (Recommended): Double-click install.ps1 or via command line: powershell -ExecutionPolicy Bypass -File install.ps1
#    Command Prompt: Double-click install.bat

# 4. Verify installation with full Windows integration
caesar --version

# 5. Test file association - double-click any .csr file!
# 6. Open VS Code - Caesar extension should be installed automatically

Option 2: NPM Package 🧪 FOR QUICK GETTING STARTED ONLY

🎯 Minimal Installation - Just the Basics

Quick Global Installation:

npm install -g caesar-lang

⚠️ Limited Functionality:

  • Basic CLI Access: caesar command available system-wide
  • Core Execution: Run .csr files from command line
  • Cross-Platform: Works on Windows, macOS, and Linux
  • NO Windows Integration: No file icons, associations, or context menus
  • NO VS Code Extension: Must install manually from marketplace
  • NO Language Server: No IDE features or autocomplete
  • NO File Recognition: Windows treats .csr files as unknown

🔄 Quick Testing Benefits:

  • Fast Installation: ~5 seconds to get running
  • 🔄 Easy Updates: npm update -g caesar-lang
  • 🌐 Cross-Platform: Test Caesar on any operating system
  • 📦 Package Manager: Integrates with Node.js workflows

💡 Perfect For:

  • Quick Evaluation: Testing Caesar language features rapidly
  • CI/CD Pipelines: Automated testing and script execution
  • Cross-Platform Development: Running Caesar on non-Windows systems
  • Temporary Use: Short-term projects without full system integration

📋 Requirements:

  • Node.js 14+ (for NPM package manager)
  • Any Operating System (Windows, macOS, Linux)

🔧 Installation Process:

# 1. Install globally (basic functionality only)
npm install -g caesar-lang

# 2. Verify basic installation
caesar --version

# 3. Run Caesar files (command line only)
caesar examples/hello_world.csr

# Note: For full experience, use Release Package instead!

📊 Installation Method Comparison

| Feature | 🏆 Release Package | ⚡ NPM Package | |---------|----------------|----------------| | Target Use Case | Full Production Experience | Quick Testing Only | | Windows File Icons | ✅ Beautiful Caesar icons | ❌ Generic file icons | | File Association | ✅ Double-click to run | ❌ Command line only | | Context Menu | ✅ Right-click integration | ❌ No integration | | VS Code Extension | ✅ Auto-installed | ❌ Manual install required | | Language Server | ✅ Full IDE features | ❌ No IDE support | | System Integration | ✅ Complete Windows integration | ❌ Basic CLI only | | Installation Time | ~60 seconds | ~30 seconds | | File Size | 12.77 MB | 11.24 MB | | Dependencies | None | Node.js 14+ | | Auto Updates | Manual download | ✅ npm update | | Cross-Platform | Windows only | ✅ All platforms | | Professional Use | ✅ Recommended | ❌ Testing only |

🎯 Which Should You Choose?

🏆 Choose Release Package If:

  • You want the complete Caesar experience
  • You're developing on Windows
  • You want beautiful file icons and system integration
  • You use VS Code for development
  • You plan to use Caesar for real projects
  • You want professional-grade tooling

Choose NPM Package If:

  • You just want to quickly test Caesar language features
  • You're on macOS or Linux
  • You're using Caesar in CI/CD pipelines
  • You don't need Windows integration
  • You prefer package managers over installers
  • You're doing temporary evaluation

🚀 Quick Start Guide

🏆 Release Package - Full Experience:

After installation, enjoy the complete Caesar experience:

# Verify your full installation (added to PATH automatically)
caesar --version

# Run examples with full Windows integration
caesar examples\hello_world.csr

# Test file association - double-click ANY .csr file!
# Files should open with beautiful Caesar icons

# VS Code Integration (automatically installed)
# - Open VS Code - Caesar extension is already there!
# - Open any .csr file - syntax highlighting works instantly
# - Press F5 to run current Caesar file
# - Click the ▶️ play button in editor toolbar
# - Right-click → "Run Caesar File"

# Context menu integration
# Right-click any .csr file in Windows Explorer:
# → "Run with Caesar"
# → "Open in Caesar REPL"

# Start interactive REPL (also added to PATH)
caesar_repl

NPM Package - Basic Testing:

Basic command-line functionality only:

# Verify basic installation (command line only)
caesar --version

# Run Caesar files (command line only - no file association)
caesar examples/hello_world.csr

# Start REPL (basic version)
caesar-repl

# ⚠️ What's MISSING with NPM:
# - No file icons (generic file appearance)
# - No double-click to run (.csr files not recognized)
# - No context menu integration
# - No VS Code extension (must install manually)
# - No Language Server Protocol support
# - No system integration

# To get VS Code support with NPM, install manually:
# 1. Open VS Code Extensions (Ctrl+Shift+X)
# 2. Search "Caesar Language Support"
# 3. Install manually (not automatic like Release Package version)

💡 Pro Tip:

Want the full Caesar experience? Use the Release Package! The NPM version is intentionally minimal - perfect for quick testing, but you'll miss out on the beautiful file icons, system integration, and automatic VS Code setup that makes Caesar a joy to use daily.

New in v1.4.0: Caesar now includes enhanced data structures (lists and dictionaries) with Python-like syntax and professional development workflow with automated scripts!

🛠️ Additional Setup (Optional)

For VS Code Users (NPM Package):

# Install Caesar VS Code extension manually
code --install-extension juliuspleunes4.caesar-language-support

For Advanced Features (NPM Package):

# Clone repository for Language Server setup
git clone https://github.com/juliuspleunes4/Caesar.git
cd Caesar/caesar-language-server
npm install
npm run compile

🎨 VS Code Integration

Professional Editor Support: Caesar has official VS Code extension support available on the Visual Studio Code Marketplace!

Automatic Installation (Release Package)

If you installed Caesar via the Release Package, the VS Code extension is automatically installed if VS Code is detected on your system. No manual setup required!

Manual Installation (NPM Package or Standalone)

# Install directly from VS Code marketplace
code --install-extension juliuspleunes4.caesar-language-support

# Or search "Caesar" in VS Code Extensions (Ctrl+Shift+X)

Extension Features

  • 🎨 Syntax Highlighting: Beautiful syntax highlighting for .csr files
  • 📝 Code Snippets: Smart autocomplete for Caesar language constructs
  • 🌙 Caesar Dark Theme: Optimized dark theme designed for Caesar development
  • 🏷️ Language Recognition: Full integration with VS Code's language ecosystem
  • 📁 File Icons: Custom icons for Caesar source files
  • 🔧 Language Server Protocol: Built-in LSP server with real-time error checking, autocomplete, and go-to-definition
  • ▶️ Run Commands: Click the play button or press F5 to instantly run Caesar files
  • 🖱️ Context Menu: Right-click in editor for "Run Caesar File" option
  • ⚡ Instant Execution: No need to open terminals or remember commands
  • ✨ Professional IDE Experience: Complete language support with zero configuration

Transform your development experience - Caesar files now have full professional IDE support with Python-like ease of use!

✨ Language Features

Core Language Constructs

  • Variables & Expressions: Full arithmetic, logical, and comparison operators
  • Control Flow: if/elif/else, while, for loops with proper nesting
  • Functions: Definitions with parameters and default values
  • Classes: Object-oriented programming with inheritance support
  • Data Structures: Lists [1, 2, 3] and dictionaries {"key": "value"}
  • Member Access: Dot notation object.property and method calls
  • Assignment Operators: Basic = and compound +=, -=, *=, /=
  • Control Statements: return, break, continue, pass

Advanced Features

  • Indentation-based Syntax: Python-style block structure
  • String Literals: Full escape sequence support including \0
  • Nested Structures: Complex nested control flow and data structures
  • Expression Precedence: Mathematically correct operator precedence
  • Error Recovery: Robust parsing with meaningful error messages

Built-in Functions Library

  • I/O Functions: print() with multiple argument support
  • Utility Functions: range() with 1-3 parameters, len() for strings
  • Type Conversion: str(), int(), float() with comprehensive type handling
  • Introspection: type() returning proper type information
  • Mathematical: abs() for integers and floats

Runtime Features

  • Dynamic Typing: std::variant based value system with automatic conversions
  • Exception Handling: Custom exception classes for runtime errors, returns, breaks, continues
  • Memory Management: Efficient value storage and copying with minimal overhead
  • Scope Management: Proper variable scoping in functions and nested structures

Example Code

# Class definition with inheritance
class Calculator:
    def __init__(self, precision=2):
        self.precision = precision
        self.history = []
    
    def add(self, a, b):
        result = a + b
        self.history.append(f"Added {a} + {b} = {result}")
        return result
    
    def calculate_series(self, numbers):
        total = 0
        for num in numbers:
            if num > 0:
                total += num
            elif num < 0:
                total -= abs(num)
            else:
                pass  # Skip zeros
        return total

# Function with default parameters
def fibonacci(n, memo={}):
    if n in memo:
        return memo[n]
    if n <= 1:
        return n
    
    memo[n] = fibonacci(n-1, memo) + fibonacci(n-2, memo)
    return memo[n]

# Main execution
def main():
    calc = Calculator(precision=3)
    numbers = [1, 2, 3, -4, 5]
    
    result = calc.calculate_series(numbers)
    fib_result = fibonacci(10)
    
    print(f"Series result: {result}")
    print(f"Fibonacci(10): {fib_result}")

if __name__ == "__main__":
    main()

🏗️ Compiler Architecture

Caesar demonstrates a complete compiler implementation with modular design:

1. Lexical Analysis (src/lexer/)

// Token recognition with full Python-like syntax support
enum class TokenType {
    // Literals
    INTEGER, FLOAT, STRING, BOOLEAN, NONE,
    
    // Keywords  
    IF, ELIF, ELSE, WHILE, FOR, DEF, CLASS, RETURN,
    BREAK, CONTINUE, PASS, AND, OR, NOT, IN,
    
    // Operators
    PLUS, MINUS, MULT, DIV, MOD, POWER,
    ASSIGN, PLUS_ASSIGN, MINUS_ASSIGN, MULT_ASSIGN, DIV_ASSIGN,
    EQUAL, NOT_EQUAL, LESS, GREATER, LESS_EQUAL, GREATER_EQUAL,
    
    // Structure
    INDENT, DEDENT, NEWLINE, EOF
};

Key Features:

  • Indentation-aware tokenization: Proper INDENT/DEDENT generation
  • String literal processing: Complete escape sequence support
  • Error reporting: Detailed position tracking for diagnostics
  • Performance optimized: Efficient character-by-character scanning

2. Syntax Analysis (src/parser/)

// Comprehensive AST with visitor pattern
class ASTVisitor {
public:
    // Expression visitors
    virtual void visit(LiteralExpression& node) = 0;
    virtual void visit(BinaryExpression& node) = 0;
    virtual void visit(CallExpression& node) = 0;
    virtual void visit(MemberExpression& node) = 0;
    
    // Statement visitors  
    virtual void visit(FunctionDefinition& node) = 0;
    virtual void visit(ClassDefinition& node) = 0;
    virtual void visit(IfStatement& node) = 0;
    virtual void visit(WhileStatement& node) = 0;
};

Key Features:

  • Recursive descent parsing: Clean, maintainable grammar implementation
  • Full AST generation: Complete abstract syntax tree representation
  • Expression precedence: Mathematically correct operator precedence
  • Error recovery: Meaningful syntax error messages with context

3. Interpreter Implementation (src/interpreter/)

// Complete interpreter with expression evaluation and statement execution
class Interpreter : public ASTVisitor {
private:
    Environment environment;
    std::unordered_map<std::string, Function> functions;
    
public:
    // Expression evaluation
    Value evaluate(Expression& expr);
    void execute(Statement& stmt);
    
    // Built-in functions
    Value callBuiltin(const std::string& name, const std::vector<Value>& args);
};

Key Features:

  • Complete Expression Evaluation: All binary/unary/call/assignment expressions
  • Full Statement Execution: If/while/for statements with proper control flow
  • Built-in Function Library: print(), range(), len(), type(), str(), int(), float(), abs()
  • Dynamic Typing: std::variant based value system with automatic conversions
  • Exception Handling: Custom runtime exceptions for errors, returns, breaks, continues
  • Memory Management: Efficient value storage and scope management

4. Distribution System (create_release.ps1)

  • Automated Release Packaging: One-click distribution creation
  • Standalone Executables: Pre-compiled binaries requiring no local compilation
  • Complete Documentation: Bundled user and developer guides
  • Cross-Platform Support: Windows executable compatibility

5. Future Enhancements (Planned)

  • Semantic Analysis: Type checking and symbol table management
  • IR Generation: LLVM intermediate representation
  • Optimization: Performance optimizations and dead code elimination
  • Code Generation: Native machine code compilation
  • Runtime System: Enhanced memory management and expanded standard library

🧪 Comprehensive Testing Framework

Caesar includes a production-quality test suite ensuring reliability and correctness:

Test Categories (9/9 Passing - 100% Success Rate)

1. Lexer Tests (test_lexer)

  • Basic tokenization (keywords, operators, literals)
  • String processing with escape sequences
  • Numeric literal parsing (integers, floats)
  • Identifier and keyword recognition

2. Advanced Lexer Tests (test_lexer_advanced)

  • Complex indentation scenarios
  • Nested block structures
  • Multi-line string handling
  • Error recovery and edge cases

3. Parser Tests (test_parser)

  • Basic statement parsing
  • Expression precedence validation
  • Function definition parsing
  • Control flow structure validation

4. Advanced Parser Tests (test_parser_advanced)

  • Complex nested structures
  • Class definition parsing
  • Member access and method calls
  • Advanced expression combinations

5. Integration Tests (test_integration)

  • End-to-end parsing workflows
  • Multi-file program structures
  • Cross-module dependencies
  • Real-world code examples

6. Stress Tests (test_stress)

  • Large-scale parsing: 1000+ function definitions
  • Deep nesting: Complex nested control structures
  • Performance benchmarks: Memory and time efficiency
  • Edge case handling: Boundary condition testing

7. Error Handling Tests (test_error_handling)

  • Syntax error detection and reporting
  • Recovery from malformed input
  • Detailed error message validation
  • Position tracking accuracy

8. Build System Tests (test_build_system)

  • CMake configuration validation
  • Cross-platform compilation
  • Dependency management
  • Installation procedures

9. Coverage Analysis (test_coverage_analysis)

  • Code coverage measurement
  • Feature completeness validation
  • Performance profiling
  • Memory leak detection

Running the Test Suite

# Run all tests
cd build && ctest --output-on-failure

# Run specific test categories
./tests/test_lexer          # Basic lexical analysis
./tests/test_parser         # Basic syntax analysis  
./tests/test_stress         # Performance and scalability
./tests/test_integration    # End-to-end workflows

# Verbose test output
ctest --output-on-failure

⚡ Development Scripts

Caesar comes with professional automation scripts that provide a streamlined development experience matching industry standards. These scripts handle all the complexity of building, testing, and environment setup automatically.

🚀 Quick Start for Developers

One-Command Testing - Build and test any Caesar file instantly:

# Build fresh binaries and run your code
.\scripts\dev-run.ps1 examples\hello_world.csr

# Show AST parsing (debug mode)
.\scripts\dev-run.ps1 -Parse examples\functions.csr

Complete Validation - Run full test suite with one command:

# Build, test, and validate everything
.\scripts\build-and-test.ps1

🔧 Professional Automation Scripts

scripts\dev-run.ps1 - Development Testing

  • Purpose: Build and run Caesar with fresh binaries every time
  • Key Feature: Prevents "wrong binary" issues by always using latest build
  • Usage: .\scripts\dev-run.ps1 <file.csr> or .\scripts\dev-run.ps1 -Parse <file.csr>

scripts\build-and-test.ps1 - Complete Validation

  • Purpose: Professional CI/CD-style validation pipeline
  • Coverage: Build verification, all 9 test suites, enhanced data structures validation
  • Output: Comprehensive summary with ✅ pass/❌ fail indicators

scripts\setup-build-env.ps1 - Environment Setup

  • Purpose: Automated MinGW/CMake environment configuration
  • Benefit: Eliminates common Windows build issues automatically
  • Usage: Run once to configure your development environment

scripts\create_release.ps1 - Release Packaging

  • Purpose: Professional release artifact generation
  • Output: Complete distributable packages with documentation

🎯 VS Code Integration

All scripts are integrated with VS Code tasks for seamless IDE experience:

  • Build Caesar (Ctrl+Shift+P → Tasks: Run Task)
  • Run All Tests
  • Dev Run (Auto-Build)
  • Clean Build

Why These Scripts Matter:

  • Professional Workflow: Matches industry-standard development practices
  • Zero Configuration: Works out-of-the-box on Windows, Linux, and macOS
  • Prevents Issues: Automatic fresh builds eliminate common development pitfalls
  • Complete Testing: Comprehensive validation including enhanced data structures
  • Developer Experience: Makes contributing to Caesar effortless

See scripts/README.md for complete documentation.

🛠️ Building Caesar

Prerequisites

Development Environment

  • CMake 3.15 or higher: Build system generator
  • C++17 compatible compiler: GCC 8+, Clang 9+, or MSVC 2019+
  • Git: Version control for source management

Platform-Specific Dependencies

Ubuntu/Debian:

sudo apt-get update
sudo apt-get install cmake build-essential git \
                     libffi-dev libncurses-dev

Windows (MinGW/MSYS2):

pacman -S mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc \
          mingw-w64-x86_64-make git

macOS:

brew install cmake gcc git

Build Instructions

# Clone the repository
git clone https://github.com/juliuspleunes4/Caesar.git
cd Caesar

# Create build directory
mkdir build; cd build

# Configure with CMake
cmake ..

# Build the project (use appropriate command for your system)
# Linux/macOS:
make -j$(nproc)
# Windows (MinGW):
cmake --build . -j

# Run the complete test suite
ctest

Windows MinGW/MSYS2 Quick Setup

For Windows users with MinGW/MSYS2, use our automated setup script to avoid common build issues:

# Automated setup (recommended for Windows)
.\scripts\setup-build-env.ps1

# Then build normally
cmake --build build
cd build && ctest

Troubleshooting Build Issues

If you encounter build problems (especially error code 0xc0000135 or CMake generator issues), see the comprehensive Troubleshooting Guide for detailed solutions.

Build Targets

# Core targets
make caesar          # Main compiler executable
make caesar_repl     # Interactive REPL
make caesar_lib      # Static library

# Test targets  
make test_lexer              # Lexical analysis tests
make test_parser             # Syntax analysis tests
make test_stress             # Performance tests
make test_integration        # End-to-end tests

# Utility targets
make clean                   # Clean build files
make doc                     # Generate documentation (requires Doxygen)

� Creating Release Packages

Caesar includes an automated release packaging system that creates distributable ZIP files for end users.

Quick Release Process

After making changes to the source code:

# 1. Build the updated version
cmake --build build --parallel

# 2. Generate release package
powershell -ExecutionPolicy Bypass -File scripts\create_release.ps1

This creates a complete standalone distribution in release/caesar-v1.4.0-windows.zip that includes:

  • ✅ Pre-compiled executables (caesar.exe, caesar_repl.exe)
  • ✅ Example programs and documentation
  • ✅ Standalone installers (no Git/CMake required for users)
  • ✅ Complete user guide and quick start instructions

Release Options

# Create release with specific version
powershell -ExecutionPolicy Bypass -File scripts\create_release.ps1 -Version "1.4.0"

# Create release in custom directory
powershell -ExecutionPolicy Bypass -File scripts\create_release.ps1 -OutputDir "dist"

Distribution

The generated Release Package file can be:

  • Uploaded to GitHub releases
  • Distributed to end users
  • Installed by users without any development tools

User installation is simple: Download → Extract → Run install.bat → Start coding!

�🔧 Debug Tools

The project includes a comprehensive set of debug tools for development and testing:

Debug Directory Structure

debug/
├── src/                     # Debug source files
│   ├── debug_basic_lexer.cpp       # Basic lexical analysis testing
│   ├── debug_comprehensive.cpp     # Complete feature testing
│   ├── debug_expressions.cpp       # Expression parsing testing
│   ├── debug_functions.cpp         # Function definition testing
│   ├── debug_if_statements.cpp     # Conditional logic testing
│   ├── debug_lexer.cpp             # Advanced lexer testing
│   ├── debug_parser.cpp            # Parser component testing
│   └── debug_while_loops.cpp       # Loop structure testing
├── bin/                     # Compiled debug executables (auto-generated)
├── build.bat               # Batch build script (cross-platform)
├── README.md               # Debug tools documentation
└── .gitignore              # Version control configuration

Building Debug Tools

Automated Build

Windows Command Prompt or Cross-platform:

cd debug
build.bat

Manual Build

# Navigate to debug directory
cd debug

# Compile individual debug tools
g++ -std=c++17 -I../include -I../src src/debug_lexer.cpp ../build/src/libcaesar_lib.a -o bin/debug_lexer

# Or compile all at once (Linux/macOS)
for file in src/*.cpp; do
    name=$(basename "$file" .cpp)
    g++ -std=c++17 -I../include -I../src "$file" ../build/src/libcaesar_lib.a -o "bin/$name"
done

Debug Tool Descriptions

| Tool | Purpose | Features | |------|---------|----------| | debug_basic_lexer | Token stream validation | Basic tokenization testing | | debug_comprehensive | Full language testing | Classes, functions, expressions | | debug_expressions | Expression analysis | Arithmetic, logical, comparison | | debug_functions | Function parsing | Parameters, defaults, calls | | debug_if_statements | Conditional logic | If/else structures, nesting | | debug_lexer | Advanced tokenization | Complex token patterns | | debug_parser | Parser validation | AST generation, syntax trees | | debug_while_loops | Loop structures | While loops, nested patterns |

Using Debug Tools

Each debug tool provides detailed output for development and troubleshooting:

# Run a specific debug tool
./bin/debug_lexer

# Example output includes:
# - Token stream analysis
# - AST structure visualization  
# - Parsing step-by-step breakdown
# - Error detection and reporting

🚀 Usage

Compiler Usage

# Compile and analyze a Caesar program
./src/caesar program.csr

# Show detailed tokenization
./src/caesar --tokens program.csr

# Display abstract syntax tree
./src/caesar --ast program.csr

# Show help and options
./src/caesar --help

REPL (Read-Eval-Print Loop)

# Start interactive development environment
./src/caesar_repl

# Example REPL session:
Caesar REPL v1.4.0
>>> def greet(name):
...     return f"Hello, {name}!"
...
>>> greet("World")
"Hello, World!"
>>> 

Example Programs

See the examples/ directory for sample Caesar programs:

./src/caesar examples/hello_world.csr    # Basic hello world
./src/caesar examples/fibonacci.csr      # Recursive fibonacci
./src/caesar examples/control_flow.csr   # Control structures
./src/caesar examples/functions.csr      # Function examples

📊 Development Status & Roadmap

✅ Completed Features (Current Release)

| Component | Status | Description | |-----------|--------|-------------| | Lexical Analysis | ✅ Complete | Full tokenization with Python-like syntax | | Syntax Analysis | ✅ Complete | Recursive descent parser with AST generation | | Language Features | ✅ Complete | Classes, functions, control flow, data structures | | Error Handling | ✅ Complete | Detailed diagnostics with position tracking | | Test Framework | ✅ Complete | Comprehensive test suite (9/9 passing) | | Build System | ✅ Complete | Cross-platform CMake configuration | | Documentation | ✅ Complete | API documentation and user guides | | VS Code Extension | ✅ Complete | Published to marketplace with syntax highlighting and LSP integration | | Language Server Protocol | ✅ Complete | TypeScript implementation with universal editor support | | NPM Package | ✅ Complete | Global installation ([email protected]) with cross-platform CLI | | File Association | ✅ Complete | Windows integration with custom icons and context menus | | Professional Installation | ✅ Complete | Automated release system with zero-manual-step setup | | Enhanced Data Structures | ✅ Complete | Lists [1, 2, 3] and dictionaries {"key": "value"} with Python-like syntax | | Development Automation | ✅ Complete | Professional workflow scripts (dev-run, build-and-test, setup-build-env) |

🚧 Planned Features (Future Releases)

| Component | Priority | Description | |-----------|----------|-------------| | Chocolatey Package | High | Windows package manager distribution with automated install script and .nuspec file | | Cross-Platform Distribution | High | Create cross-platform builds (macOS, Linux) and automated distribution system | | Multi-Editor Support | Medium | Create editor plugins for IntelliJ, Sublime Text, Vim, etc. using existing LSP server | | Semantic Analysis | High | Type checking and symbol table management | | LLVM IR Generation | High | Intermediate representation for optimization | | Code Optimization | Medium | Performance optimizations and dead code elimination | | Native Compilation | High | Machine code generation and linking | | Runtime System | Medium | Memory management and garbage collection | | Extended Standard Library | Medium | Additional built-in functions and advanced data structure operations | | Module System | Low | Import/export functionality | | Debugger Support | Low | Debug information and breakpoint support |

📈 Performance Metrics

Compiler Performance

Current parser performance (measured on test suite):

  • Large file parsing: 1000 functions in ~8ms
  • Deep nesting: 100+ nested levels in <1ms
  • Complex expressions: 2000+ operations in ~1ms
  • Memory efficiency: Minimal allocation overhead
  • Error recovery: Fast syntax error detection

Runtime Performance Benchmarks

Comprehensive performance comparison with identical algorithms across Caesar, Python, and C++ (measured on Windows 11, MinGW GCC 13.2.0):

🏆 Caesar vs C++ Performance - Identical Algorithms:

Factorial Computation:

Scale: 15    Caesar: 11.5ms  |  C++: 9.9ms (1.15x faster)
Scale: 20    Caesar: 21.1ms  |  C++: 11.7ms (1.82x faster)

Prime Number Checking:

Scale: 1K     Caesar: 19.8ms  |  C++: 30.2ms (Caesar 1.54x faster) ⭐
Scale: 10K    Caesar: 17.9ms  |  C++: 22.6ms (Caesar 1.27x faster) ⭐
Scale: 100K   Caesar: 24.9ms  |  C++: 21.8ms (1.14x faster)

String Operations:

Scale: 1K     Caesar: 13.1ms  |  C++: 27.6ms (Caesar 2.13x faster) ⭐
Scale: 10K    Caesar: 9.6ms   |  C++: 8.9ms (1.08x faster)
Scale: 100K   Caesar: 12.8ms  |  C++: 11.3ms (1.14x faster)

Fibonacci Sequence:

Scale: 30     Caesar: 10.3ms  |  C++: 10.4ms (Caesar 1.01x faster) ⭐
Scale: 35     Caesar: 15.3ms  |  C++: 22.0ms (Caesar 1.43x faster) ⭐

Loop Performance:

Scale: 100K   Caesar: 9.3ms   |  C++: 25.6ms (Caesar 2.78x faster) ⭐
Scale: 1M     Caesar: 10.6ms  |  C++: 9.6ms (1.11x faster)
Scale: 10M    Caesar: 17.0ms  |  C++: 9.3ms (1.82x faster)

🚀 Caesar vs Python Performance:

All benchmarks show Caesar consistently 2-50x faster than Python:

Factorial (Scale 10):     Caesar 11.5ms  |  Python 38.7ms  (3.33x faster)
Prime Checking (100K):    Caesar 24.9ms  |  Python 86.0ms  (4.00x faster)
String Ops (1K):         Caesar 13.1ms  |  Python 38.3ms  (2.94x faster)
Fibonacci (35):          Caesar 15.3ms  |  Python 780ms   (50x faster!)
Loop Performance (10M):   Caesar 17.0ms  |  Python 490ms   (30x faster!)

Key Performance Highlights:

  • 🏆 Competitive with C++: Caesar often matches or beats optimized C++ performance
  • Interpreter Excellence: Remarkable performance for an interpreted language
  • 📈 Consistent Python Superiority: 2-50x faster than Python across all workloads
  • 🎯 Caesar's Sweet Spots: Prime checking, string operations, moderate-scale loops
  • ⚖️ Fair Comparison: All languages run identical algorithms (standardized for accuracy)

Caesar demonstrates that well-designed interpreters can compete with compiled languages!

Run tests/comparison/run_benchmarks.ps1 to reproduce these results

🏛️ Language Grammar

Caesar follows a context-free grammar suitable for recursive descent parsing:

program          ::= statement*

statement        ::= simple_stmt | compound_stmt
simple_stmt      ::= expression_stmt | return_stmt | break_stmt | continue_stmt | pass_stmt
compound_stmt    ::= if_stmt | while_stmt | for_stmt | function_def | class_def

function_def     ::= "def" IDENTIFIER "(" parameters? ")" ":" NEWLINE INDENT statement+ DEDENT
class_def        ::= "class" IDENTIFIER ("(" identifier_list ")")? ":" NEWLINE INDENT statement+ DEDENT
parameters       ::= parameter ("," parameter)*
parameter        ::= IDENTIFIER ("=" expression)?

if_stmt          ::= "if" expression ":" suite ("elif" expression ":" suite)* ("else" ":" suite)?
while_stmt       ::= "while" expression ":" suite  
for_stmt         ::= "for" IDENTIFIER "in" expression ":" suite
suite            ::= NEWLINE INDENT statement+ DEDENT

expression       ::= assignment
assignment       ::= logical_or (("=" | "+=" | "-=" | "*=" | "/=") assignment)?
logical_or       ::= logical_and ("or" logical_and)*
logical_and      ::= equality ("and" equality)*
equality         ::= comparison (("==" | "!=") comparison)*
comparison       ::= term (("<" | "<=" | ">" | ">=") term)*
term             ::= factor (("+" | "-") factor)*
factor           ::= unary (("*" | "/" | "%") unary)*
unary            ::= ("not" | "-" | "+") unary | call
call             ::= primary ("(" arguments? ")" | "." IDENTIFIER)*
primary          ::= IDENTIFIER | literal | "(" expression ")" | list_literal | dict_literal

literal          ::= INTEGER | FLOAT | STRING | BOOLEAN | NONE
list_literal     ::= "[" (expression ("," expression)*)? "]"
dict_literal     ::= "{" (expression ":" expression ("," expression ":" expression)*)? "}"

📚 Documentation Suite

Caesar includes a comprehensive professional documentation suite located in the docs/ directory, providing complete guidance for users and developers.

User Documentation

SYNTAX.md - Complete Language Reference

  • Full language specification with Python syntax highlighting
  • Comprehensive examples for all language features
  • Quick reference guide for developers coming from Python
  • Best practices and coding conventions

TROUBLESHOOTING.md - Problem Solving Guide

  • Installation issues and environment setup
  • Build problems and dependency resolution
  • Runtime errors and debugging techniques
  • Performance optimization tips and techniques

FAQ.md - Frequently Asked Questions

  • Common questions about Caesar's capabilities
  • Performance comparisons with other languages
  • Learning resources and getting started guides
  • Community support and contribution information

Developer Documentation

CONTRIBUTING.md - Contributor Guidelines

  • Development workflow and coding standards
  • Pull request process and review guidelines
  • Testing requirements and quality assurance
  • Code style guides and architecture principles

ARCHITECTURE.md - Technical Implementation

  • System design and component architecture
  • Implementation details for lexer, parser, and interpreter
  • Extension points for adding new features
  • Performance considerations and optimization strategies

ROADMAP.md - Development Planning

  • Future feature development plans and priorities
  • Version timeline and release scheduling
  • Technical milestones and implementation targets
  • Community feedback integration and planning

Project Management Documentation

SECURITY.md - Security Policy

  • Vulnerability reporting procedures and guidelines
  • Security best practices for Caesar development
  • Responsible disclosure process and timelines
  • Security update policies and notification procedures

CODE_OF_CONDUCT.md - Community Guidelines

  • Behavior standards for community interaction
  • Enforcement procedures and conflict resolution
  • Inclusive environment policies and practices
  • Contact information for community management

CHANGELOG.md - Version History

  • Detailed release notes for all versions
  • Feature additions and improvements tracking
  • Bug fixes and issue resolution documentation
  • Performance improvements and benchmarking results

🤝 Contributing

Caesar is an open-source project welcoming contributions from developers interested in programming language design and compiler implementation.

Development Guidelines

Code Standards

  • Modern C++17: Use latest language features appropriately
  • RAII principles: Proper resource management with smart pointers
  • Const correctness: Immutable data where possible
  • Exception safety: Robust error handling throughout
  • Documentation: Comprehensive Doxygen-style comments

Architecture Principles

  • Modular design: Clear separation of concerns
  • Visitor pattern: Extensible AST traversal
  • Error recovery: Graceful handling of invalid input
  • Performance: Efficient algorithms and data structures
  • Testing: Comprehensive coverage for all features

Contribution Process

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Implement your changes with tests
  4. Ensure all tests pass (ctest)
  5. Document your code thoroughly
  6. Submit a pull request

Areas for Contribution

High Priority

  • LLVM IR Generation: Implement intermediate representation
  • Semantic Analysis: Type checking and symbol tables
  • Optimization Passes: Performance improvements
  • Error Messages: Enhanced diagnostic information

Medium Priority

  • Standard Library: Built-in functions and modules
  • Runtime System: Memory management implementation
  • Debugging Support: Debug information generation
  • Platform Support: Additional OS/architecture support

Documentation & Testing

  • API Documentation: Expand code documentation
  • Tutorial Content: Learning resources for users
  • Benchmark Suite: Performance regression testing
  • Example Programs: Real-world Caesar applications

Building Documentation

# Install Doxygen
sudo apt-get install doxygen graphviz

# Generate API documentation
cd build
make doc

# View documentation
open docs/html/index.html  # macOS
xdg-open docs/html/index.html  # Linux

📄 License

MIT License - see LICENSE file for complete details.

Copyright (c) 2025 J.J.G. Pleunes

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

👨‍💻 Author & Acknowledgments

Built with ❤️ by Julius Pleunes - Creator and maintainer of Caesar

Project Inspiration

  • Python: Syntax design and language philosophy
  • LLVM: Compiler infrastructure and optimization techniques
  • Modern C++: Implementation language and best practices
  • Crafting Interpreters: Theoretical foundation and parsing techniques

Technical Acknowledgments

  • CMake Community: Build system and cross-platform support
  • Doxygen: Documentation generation tools
  • Open Source Community: Continuous learning and collaboration

🌐 Links & Resources

Official Website

🌍 www.caesarlang.com - Complete documentation, playground, and downloads

Development & Community

Contact & Support