DevOps

rustc – compiler for Rust

rustc is the compiler for the Rust programming language. It translates Rust source code into executable programs and libraries, enforcing the language’s rules before generating machine code. Although developers generally invoke rustc through Cargo, the compiler can also be used directly for individual programs and more specialized compilation tasks.

An important part of rustc’s work happens before machine-code generation. The compiler checks ownership, borrowing, lifetimes, types, and trait implementations, rejecting programs that violate Rust’s safety rules. These checks allow many memory-management errors to be detected during compilation rather than at runtime. After analysis, the program passes through intermediate representations used for optimization and code generation. rustc also employs a query-based architecture that helps it reuse previously computed information when source files change, reducing redundant work during development.

This is free and open source software.

Key Features

  • Compilation of Rust source code into native executables and libraries.
  • Ownership and borrowing checks that enforce Rust’s memory safety rules.
  • Static type checking, type inference, and trait resolution.
  • Lifetime analysis and validation of references.
  • Macro expansion for declarative and procedural macros.
  • Monomorphization of generic functions and types.
  • Incremental compilation that reuses results from previous compilation sessions.
  • LLVM-based machine-code generation and optimization.
  • Configurable optimization, code-generation, and debugging options.
  • Detailed error diagnostics with source locations and suggested corrections.
  • Support for conditional compilation using configuration attributes.
  • Generation of LLVM intermediate representation and assembly output.
  • Cross-compilation for supported operating systems and processor architectures.
  • Support for compiler plugins through the established procedural macro interface.
  • Cross-platform support – runs on Linux, macOS, and Windows.

Website: github.com/rust-lang/rust
Support:
Developer: Rust Project contributors
License: Apache License 2.0 and MIT License

rustc itself is written in Rust. Learn Rust with our recommended free books and free tutorials.


Related Software

Compilers
GNU Compiler CollectionThe standard compiler for most Unix-like operating systems
rustcCompiler for the Rust programming language
AOCCAMD Optimizing C/C++ Compiler
LLVMLow-Level Virtual Machine (LLVM) compiler for C/C++
ispcIntel SPMD Program Compiler
BabelJavaScript compiler - use next generation JavaScript
Glasgow Haskell CompilerAn optimizing compiler for Haskell, written in Haskell
ClangC Language Family Frontend for LLVM
NuitkaOptimizing Python compiler
CHICKENCompiler for the Scheme programming language
FreeBASIC32-bit BASIC compiler
NumbaCompiler for Python array and numerical functions
Free PascalAdvanced Pascal compiler for Pascal and Object Pascal
NASMAssembler for the x86 CPU architecture
BiglooPractical Scheme compiler

Read our verdict in the software roundup.


Best Free and Open Source Software LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted