Introduction#

pperl is a next-generation Perl 5 platform written in Rust, targeting Perl 5.44+ compatibility.

Goals#

  • JIT Compilation - Native code generation via Cranelift for hot loops and hot recursive subs, with byte-identical output to the interpreter

  • Auto-Parallelization - Qualifying JIT-compiled for and while loops spread across CPU cores, only where the result is provably identical

  • Pure Perl Viability - Fast enough that XS becomes optional

Architecture Overview#

        flowchart LR
    A[Perl Source] --> B[Parser]
    B --> C[Op Tree]
    C --> D[Interpreter]
    C -->|hot loops and subs| E[Cranelift JIT]
    E -->|qualifying loops| F[Parallelizer]
    D --> G[Result]
    E --> G
    F --> G
    

The parser and the interpreter follow perl5’s own design: the same grammar, the same op tree, the same op-by-op execution. On top of that, the JIT compiles hot code to native machine code and declines whatever it cannot reproduce exactly, and the parallelizer spreads qualifying compiled loops across cores. Modules that perl5 implements in XS are built into pperl as native modules.

Quick Start#

# Run a script
pperl script.pl

# Run one-liner
pperl -e 'print "Hello, World!\n"'

# Check syntax only
pperl -c script.pl

Compatibility#

pperl aims for high compatibility with Perl 5.44+.

Platform Support#

  • Linux only, on the architectures Cranelift supports: x86-64, AArch64, RISC-V and IBM z/Architecture

  • No Windows, macOS, or other platforms