# IRTools and Core.Compiler

**URL:** <https://discourse.julialang.org/t/irtools-and-core-compiler/71311>\
**Category:** Internals & Design\
**Created:** [November 11, 2021, 7:29am UTC](https://discourse.julialang.org/t/irtools-and-core-compiler/71311 "2021-11-11T07:29:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![KDr2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kdr2/32/2542_2.png) [@KDr2](https://discourse.julialang.org/u/KDr2)\
**Post date:** [November 11, 2021, 7:29am UTC](https://discourse.julialang.org/t/irtools-and-core-compiler/71311/1 "2021-11-11T07:29:24Z")

</div>

I noticed `IRTools.jl` doesn’t work any longer on the latest Julia (1.8.x or the master branch). And from long ago, there exists a module named `Core.Compiler`, but I failed to find any document about this module.

I have a few questions about these two PKGs/Modules:

- Will `IRTools.jl` be deprecated? I saw it had been untouched(source and issues on github) for a long time.
- Can `Core.Compiler` be used in the places where IRTool.jl was used? and is there any document to show how to use it?

Thanks.

---

<div class="post-metadata">

**Author:** ![simeonschaub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simeonschaub/32/216566_2.png) [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)\
**Post date:** [November 11, 2021, 4:35pm UTC](https://discourse.julialang.org/t/irtools-and-core-compiler/71311/2 "2021-11-11T16:35:34Z")

</div>

> [@KDr2](#):
>
> Will `IRTools.jl` be deprecated? I saw it had been untouched(source and issues on github) for a long time.

It’s the basis for Zygote, which is still widely used, so we still hope to support it in the near future. There aren’t many people maintaining it right now unfortunately, so issues might not always get fixed right away. Also note that 1.8 is still far from an official release (1.7 isn’t even officially out yet), so it’s expected that packages relying heavily on internals might not work yet. I will try to look into the issue though when I have some time.

> [@KDr2](#):
>
> Can `Core.Compiler` be used in the places where IRTool.jl was used? and is there any document to show how to use it?

There might be some confusion here. `Core.Compiler` is Julia’s own compiler, which does type inference for example and other Julia-specific optimization passes. It is true that it works with a data structure called `IRCode`, which inspired the way `IRTools` works, but `IRTools` tries to be more user-friendly by making it harder to write invalid IR that will lead to segfaults.

There is a way for packages to hook into the compiler using the `AbstractInterpreter` interface which is already used by packages such as GPUCompiler, Cthulhu and JET, but this is still quite manual and low-level and doesn’t compose. The eventual goal is to replace Cassette and IRTools with something using `AbstractInterpreter`, which you can already try as [Mixtape](https://github.com/JuliaCompilerPlugins/Mixtape.jl). It should be mentioned that this is still very much work in progress though.
