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.

[!IMPORTANT]

Experimental Pyright Features

xDSL currently relies on an experimental feature of Pyright called TypeForm. TypeForm is in discussion and will likely land in some future version of Python.

For xDSL to type check correctly using Pyright, please add this to your pyproject.toml:

[tool.pyright]
enableExperimentalFeatures = true

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xdsl-0.70.0.tar.gz (4.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xdsl-0.70.0-py3-none-any.whl (4.5 MB view details)

Uploaded Python 3

File details

Details for the file xdsl-0.70.0.tar.gz.

File metadata

  • Download URL: xdsl-0.70.0.tar.gz
  • Upload date:
  • Size: 4.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.16

File hashes

Hashes for xdsl-0.70.0.tar.gz
Algorithm Hash digest
SHA256 86295a650cca786f2da2b5ec23953c777e6cd2b90b1315a39bd4a123742666a9
MD5 3b36609afbabfe0cb5a91a6dbfdc4b11
BLAKE2b-256 ce67a303961d494bb3f95f5d030632912fde66bb53e5743ef7b9a322b0f12e7b

See more details on using hashes here.

File details

Details for the file xdsl-0.70.0-py3-none-any.whl.

File metadata

  • Download URL: xdsl-0.70.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.16

File hashes

Hashes for xdsl-0.70.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f80a5356470af0dac46083ddde5bf1896271f19676aac7fb04ba44590d47c52b
MD5 2c2685febbbcc8b50390154ee59c6483
BLAKE2b-256 d489049f192e68cc95a69334ffad9f5af93f23b7b46a104dd45fa733b5ba5ef7

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.70.0 This release

2 files

0.69.0

2 files

0.68.0

2 files

0.67.0

2 files

0.66.0

2 files

0.65.0

2 files

0.64.0

2 files

0.63.0

2 files

0.62.1

2 files

0.62.0

2 files

0.61.0

2 files

0.60.0

2 files

0.59.0

2 files

0.58.0

2 files

0.57.3

2 files

0.57.2

2 files

0.57.1

2 files

0.57.0

2 files

0.56.2

2 files

0.56.1

2 files

0.56.0

2 files

0.55.4

2 files

0.55.3

2 files

0.55.2

2 files

0.55.1

2 files

0.55.0

2 files

0.54.4

2 files

0.54.3

2 files

0.54.2

2 files

0.54.1

2 files

0.54.0

2 files

0.53.0

2 files

0.52.0

2 files

0.51.0

2 files

0.50.0

2 files

0.49.0

2 files

0.48.3

2 files

0.48.2

2 files

0.48.1

2 files

0.48.0

2 files

0.47.0

2 files

0.46.0

2 files

0.45.0

2 files

0.44.0

2 files

0.43.0

2 files

0.42.0

2 files

0.41.0

2 files

0.40.0

2 files

0.39.0

2 files

0.38.1

2 files

0.38.0

2 files

0.37.0

2 files

0.36.0

2 files

0.35.0

2 files

0.31.1

2 files

0.31.0

2 files

0.30.1

2 files

0.29.1

2 files

0.29.0

2 files

0.28.0

2 files

0.27.0

2 files

0.26.0

2 files

0.25.0

2 files

0.24.0

2 files

0.23.0

2 files

0.22.0

2 files

0.21.1

2 files

0.21.0

2 files

0.20.0

2 files

0.19.0

2 files

0.18

2 files

0.17

2 files

0.16.0

2 files

0.15.0

2 files

0.14.0

2 files

0.13.0

2 files

0.12.1

2 files

0.11.0

2 files

0.10.0

2 files

0.9.1

2 files

0.9

2 files

0.8.1

2 files

0.8.0

2 files

0.7.5

2 files

0.7.4

2 files

0.7.1

1 file

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

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