O'Reilly logo

Mastering Rust by Vesa Kaihlavirta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

LLVM

Rust's compiler is based on LLVM, a compiler framework that allows easier and more robust writing of compilers. In its core is a language called IR, short for Intermediate Representation. It is sort of a middle ground between an actual programming language and a machine-specific assembler language.

Implementing a compiler for a new language with LLVM means writing a new frontend for your language: a program that takes in a program written in the new language and outputs LLVM IR codes. LLVM itself contains backends for several target architectures, which means that a developer of a new language will get more things for free.

The IR is not completely independent of the target machine, just less so. New frontends do have to make some choices ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required