Stage 2 Proposal: Standardise a binary format for ZIR, and enable compilation to and from this representation #5635
Labels
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone
EDITED -- original text is quoted below
There are a huge variety of hardware architectures in the world, both professionally designed and hobbyist. It would be impossible to actively support all of them in upstream Zig, however we can provide facilities for end users to support them themselves.
The simplest way to do this would be to standardise a binary representation of ZIR, add a command line option to emit this representation, and allow users to develop their own backends consuming this. To allow other language projects to leverage Zig's infrastructure, we could also add a command line option to compile from this representation to native code, and allow users to develop their own frontends as well. If we wanted to go really insane, we could provide these compilation stages as libraries, permitting tighter integration with a host or guest project.
We'd want to wait a while before attempting this, and even then we'd only want to expose a very high-level view of the compilation process, to avoid nailing things down too hard and preventing future optimisations or improvements. Once we've navigated all of that though, this could be a killer feature.
The text was updated successfully, but these errors were encountered: