An MLIR toolkit for building compilers and IR transformations using Elixir and Zig, offering a declarative, SSA-native frontend.
Beaver is an MLIR toolkit that provides a declarative frontend in Elixir for building compilers and performing IR transformations. It solves the complexity of traditional MLIR workflows involving C++, TableGen, CMake, and Python by offering a unified, SSA-native interface that accelerates prototyping and development.
Compiler engineers and researchers exploring MLIR-based projects, especially those familiar with Elixir or seeking a more expressive, rapid-iteration alternative to C++/Python toolchains.
Developers choose Beaver for its intuitive Elixir-based DSL that mirrors MLIR SSA structure, enabling faster edit-build-test cycles and leveraging Elixir's concurrency and meta-programming for extensible compiler development.
MLIR Toolkit in Elixir and Zig.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses Elixir's SSA nature and macros to build MLIR ops in a structure mirroring generated code, improving readability and reducing boilerplate, as shown in the Func.func example with blocks and SSA assignments.
Parallel compilation in Elixir and Zig enables rapid edit-build-test loops at seconds, emphasized in the goals for quick iteration on compiler ideas.
Wraps MLIR C APIs into Elixir structs with protocols like Enumerable, allowing seamless use with standard libraries for operations on IR components, per the high-level API design principles.
Compiles Elixir pattern-matching code to MLIR's PDL dialect, facilitating intuitive pattern definition and rewrites, demonstrated in the ToyPass example with defpat and rewrite blocks.
Requires knowledge of Elixir, which is less common in compiler engineering than C++/Python, potentially hindering adoption and limiting available expertise or tutorials.
At version 0.4.0, it lacks the stability, comprehensive testing, and feature completeness of established MLIR tools, as admitted in the motivation as an alternative approach.
Being a new project, it has a smaller community and fewer third-party integrations compared to mainstream MLIR, which might complicate debugging or extending with custom dialects.