Crates.io | abstraps |
lib.rs | abstraps |
version | 0.1.8 |
source | src |
created_at | 2021-12-06 22:04:47.596332 |
updated_at | 2021-12-31 22:22:33.150061 |
description | Extensible compiler middle layer with abstract interpretation and code generation to MLIR. |
homepage | |
repository | https://github.com/femtomc/abstraps |
max_upload_size | |
id | 493414 |
size | 125,720 |
Extensible compiler design with abstract interpreters.
This project started off as an experiment in compiler design. Specifically, the author was motivated by:
It turns out that there are quite a few of languages (e.g. Crystal, Nim, Julia) experimenting with abstract interpretation as part of their type systems. In the long term, the goal of the project might be to provide a stable substrate to experiment on compiler design cons abstract interpreters inside of an IR framework which supports MLIR-like extensibility concepts.
The framework provides:
"Extensibility" means that there are no fixed intrinsics built into the IR (or any of the interfaces). The same is true for abstract lattices -- the interpreter patterns describe how (certain instances) of abstract interpreters will traverse the IR, but the user must provide the semantics by specifying intrinsics and how the interpreter should interpret the intrinsics on a user-defined lattice.
Note:
The original author would have liked to just do this in MLIR proper -- but given time constraints and engineering ability (or lack thereof in C++), this project is implemented in Rust. In fact, for those interested in MLIR -- you may find "another implementation viewpoint" useful on the design concepts. The codebase has been documented with respect to non-trivial implementation decisions and their motivation from MLIR.