[Mlir-commits] [mlir] [MLIR][Python] Add a DSL for defining dialects in Python bindings (PR #169045)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sun Jan 11 04:35:15 PST 2026
PragmaTwice wrote:
> it's got some constraints that aren't expressible in Python's type system, such as "and" constraints, constraints that customize error strings, bounded constraints, range constraints
Personally, I don’t think it’s realistic to fully map all constraints into Python’s type system (i.e., in a way that can all be statically type-checked). Instead of treating a complete mapping as the goal, I think we should aim to map as much as we can while accepting that some parts won’t be statically checkable. For example, by introducing constructs like `AllOf[T, U]` that type checkers don’t understand.
> it might make sense to keep the xDSL and MLIR bindings not too different in order to make it easier for them to keep in sync given they're doing something quite similar
Ah, it definitely makes sense to keep the syntax of xdsl and the MLIR Python bindings similar, but as I explained to @rolfmorel at the beginning, I’m not really planning to treat that as a goal, mainly because it would introduce some additional design and development overhead.
https://github.com/llvm/llvm-project/pull/169045
More information about the Mlir-commits
mailing list