Size: 716
Comment:
|
Size: 868
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 28: | Line 28: |
It is more common to use `cargo`, which wraps `rustc`. It depends on the project following a standard file structure, and on being in the project's root directory. | It is more common to use `cargo(1)`, which wraps `rustc(1)`. It depends on the project following a standard file structure, and on being in the project's root directory. |
Line 36: | Line 36: |
The `release` flag enables all optimizations. These optimizations are also accessible with `rustc(1)`, but through multiple flags and options. |
Rust
The Rust programming language is a compiled, static-typed language built on top of the LLVM project.
Contents
Example
A hello world program looks like:
fn main() { println!("Hello World!"); }
To compile and run the program, try:
rustc hello.rs ./hello
It is more common to use cargo(1), which wraps rustc(1). It depends on the project following a standard file structure, and on being in the project's root directory.
cargo build --release ./hello # or cargo run
The release flag enables all optimizations. These optimizations are also accessible with rustc(1), but through multiple flags and options.