Skip to main content

Build Status for the Core backend PyPI version Downloads Downloads Code Coverage Zulip Status

xDSL: A Python-native SSA Compiler Framework

xDSL is a Python-native framework for building compiler infrastructure. It provides SSA-based intermediate representations (IRs) and Pythonic APIs to define, assemble, and optimize custom IRs—all with seamless compatibility with MLIR from the LLVM project.

Inspired by MLIR, xDSL enables smooth translation of programs and abstractions between frameworks. This lets users prototype compilers entirely in Python, while still accessing MLIR's powerful optimization and code generation pipeline. All IRs in xDSL employ a unified SSA-based data structure, with regions and basic blocks, making it easy to write generic analyses and transformation passes.

xDSL supports assembling compilers from predefined or custom IRs, and organizing transformations across a multi-level IR stack. This layered approach enables abstraction-specific optimization passes, similar to the architecture of projects like Devito, PSyclone, and Firedrake.

In short, xDSL makes it possible to:

  • Prototype compilers quickly in Python
  • Build DSLs with custom IRs
  • Run analyses and transformations with simple scripts
  • Interoperate smoothly with MLIR and benefit from LLVM's backend

Contents

Installation

To contribute to xDSL, follow the xDSL Developer Setup Guide.

To use xDSL as part of a larger project for developing your own compiler, just install xDSL via pip:

pip install xdsl

To quickly install xDSL for development and contribution purposes, use:

pip install xdsl[dev]

This may be useful for projects wanting to replicate the xDSL testing setup.

Note: This version of xDSL is validated against a specific MLIR version, interoperability with other versions is not guaranteed. The supported MLIR version is 22.1.2.

Subprojects With Extra Dependencies

xDSL has a number of subprojects, some of which require extra dependencies. To keep the set of dependencies to a minimum, these extra dependencies have to be specified explicitly, e.g. by using:

pip install xdsl[gui] # or [jax], [riscv]

Getting Started

Check out the dedicated Getting Started guide for a comprehensive tutorial.

To get familiar with xDSL, we recommend starting with our tutorial notebooks. The notebooks provide hands-on examples and documentation of xDSL's core concepts: data structures, the Python-embedded abstraction definition language, and end-to-end custom compilers construction, like a database compiler. There also exists a small documentation showing how to connect xDSL with MLIR for users interested in that use case.

We provide a Makefile containing a lot of common tasks, which might provide an overview of common actions.

Discussion

You can also join the discussion at our Zulip chat room, kindly supported by community hosting from Zulip.

Metadata

Release files for xdsl 0.75.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xdsl 0.75.0
File Size Uploaded Provenance Actions
xdsl-0.75.0.tar.gz 4.3 MB Without provenance Details for xdsl-0.75.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xdsl 0.75.0
File Interpreter ABI Platform Actions
xdsl-0.75.0-py3-none-any.whl Python 3 none any Details for xdsl-0.75.0-py3-none-any.whl

Total release size: 9.0 MB

Release files / xdsl-0.75.0.tar.gz

Download URL xdsl-0.75.0.tar.gz
Size 4.3 MB
Tags Source
SHA-256 checksum
How to use checksums
549656b4ab43d9ad9712a7e8ea6bb02b08376f952a7a1060ae43fde1d90c5eb5
BLAKE2b-256 checksum
How to use checksums
ea5d7b943b8f23fd9d012541789984624a76c9d067eafd1adb66d23859bd5fb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / xdsl-0.75.0-py3-none-any.whl

Download URL xdsl-0.75.0-py3-none-any.whl
Size 4.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
bce296e862b65077e413cbb08bd8ef33c6f863d49d396dcf46c65831c8a0ca48
BLAKE2b-256 checksum
How to use checksums
09bb0ee60b34b5e4249476a2e20fbf413777637f862a8395a25bb9f313ac31c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for xdsl 0.75.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.75.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page