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.74.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.74.0
File Size Uploaded Provenance
xdsl-0.74.0.tar.gz 4.3 MB Without provenance Details

Built distribution (wheel)

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

Total release size: 8.9 MB

Release files / xdsl-0.74.0.tar.gz

Download URL xdsl-0.74.0.tar.gz
Size 4.3 MB
Tags Source
SHA-256 checksum
How to use checksums
73e9df62bc4b67c296449da4935e26f0e2fbc5f6fb53a0747f1292fd72477015
BLAKE2b-256 checksum
How to use checksums
37728c94587e018de9c680cb5c96c6df8c0fb34f3ef488968b201659a8e5f4e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

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

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

Security for xdsl 0.74.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.74.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