Druid implements an optimizing compiler infraestructures to develop compilers in Pharo. The core includes an Intermediate Representation in SSA form and Optimizations that manipulate it. The goal of these project is to reuse the IR and optimization implementations between different compilers made in Pharo.
You can inspect the IR, visualize the Control Flog Graph and interact with the Instructions.
Currently, Druid is used in two compiler implementations:
-
Druid - Cogit: a metacompiler to generate the Baseline JIT Compiler of the Pharo VM from its Interpreter. Read more here
-
Druid - Opal: an optimizing bytecode compiler for Pharo. Read more here
You can install the core by running
Metacello new
repository: 'github://Alamvic/druid:main';
baseline: 'Druid';
load: 'Core' To contribute to any compiler implementation, check the installation page.
Druid is part of research papers and thesis
- Are Abstract-interpreter Baseline JITs Worth it? – CGO 2026 - https://inria.hal.science/hal-05407834
- DRUID - Metacompilation of Baseline JIT Compilers – PhD Thesis - https://hal.science/tel-05492093
- PiNodes in the Druid Meta-Compiler - IWST 2025 - https://inria.hal.science/hal-05262681/document
- Meta-compilation of Baseline JIT Compilers with Druid – Programming 2025 – https://arxiv.org/abs/2502.20543
- Ordering Optimisations in Meta-Compilation of Primitive Methods - FAST 2022 - https://openreview.net/pdf?id=jYsMG5sjQy
For questions and bug reports, please open an issue.
If you already have something implemented, we would love to receive a Pull Request.
You can contact us in the Pharo Discord.