Foreword

Carefully we wipe them hour by hour, And let no dust alight.

— stuuupidcat, 2025-04-24, Beijing

Getting Started with RPL

Installation

First, clone the RPL repository git clone https://github.com/RPL-Toolchain/RPL.git && cd RPL.

Then, use cargo install --path . in current directory to install RPL as a cargo subcommand.

Then, use cargo +nightly-2025-02-14 rpl to run RPL in your own repository to detect errors, where +nightly-2025-02-14 is the current toolchain RPL is using. You may upate this argument if RPL is switched into a new toolchain.

Every three months (or so), the toolchain will be updated to the latest nightly version. You can check the current toolchain by running rustc -V in the RPL repository.

Hello World

Why We Need a Pattern Language for Code

Quick CLI Tour: cargo rpl

Language Fundamentals

Syntax Overview

Meta-Variabl es & Placeholders

Pattern Blocks

Constraints & Predicates

Match Output & Diagnostics

Semantics Model

MIR Basics and Integration

Control-Flow & Data-Dependence Graphs

Semantic Equivalence Checking

Inline MIR vs Traditional MIR

Case Studies

Memory-Safety CVEs

Undefined Behavior

Open-Source Projects

Appendices

Complete Syntax Reference

Error Codes & Remedies

Patterns