Skip to content

Comparing with IR from other languages

An Intermediate Representation (IR) is a language that a compiler uses for a middle step while compiling code. It sits at a lower level of abstraction than your source language but higher than raw machine code.

vctx uses MLIR as an IR, relying mainly on dialects from the CIRCT project.

The awesome thing about it is that you can translate from CIRCT MLIR to Verilog or System C, which makes vctx compatible with existing toolchains.

Here is a table to explain how mlir sits when comparing to other languages. You can basically think of mlir as something similar to bytecode!

| Language | Source | Intermediate Format | |—:------------------|—:------------|—:-------------------------| | vctx (Hardware) | .vctx | .mlir | | C / C++ | .c / .cpp | .gimple or .ll | | Rust | .rs | .mir.ll | | Swift | .swift | .sil.ll | | Java | .java | .class | | C# / .NET | .cs | .il | | Python | .py | .pyc | | JavaScript (V8) | .js | V8 Bytecode |