RustでHello World
RustでHello Worldするまで。 最近はasdfを使用しているので、rustもこれでインストールした。 $ asdf plugin-add rust $ asdf install rust latest # このときは1.15.0がインストールされた $ asdf reshim rust $ asdf global rust 1.15.0 $ cargo -V 適当にディレクトリを作って main.rs ファイルを作成する mkdir rust_hello-world cd rust_hello-world vim main.rs fn main() { println!("Hello World"); } 作成したrustファイルをコンパイルして実行する。 $ rustc main.rs $ ./main Hello World 参考 Hello, World! - The Rust Programming Language 日本語版