10
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

RustのGET STARTEDをやってみました 〜〜Elixirを好きなAlchemistがRustaceanにもなるまで〜〜

Last updated at Posted at 2024-09-30

はじめに

Rustに入門してみました。
動機は、会社の同僚がRustでQiita記事投稿キャンペーンに応募して 最優秀賞(Apple Watch) を獲得したからです。選出理由にRustが挙げられていました。このビッグウェーブ🌊に乗るしかありません!

スクリーンショット 2024-09-29 9.44.20.png

私はElixirというプログラミング言語が好きです。

最優秀賞記事

@haw_ohnuma さんが最優秀賞(Apple Watch)を受賞した記事です。

入賞記事

私も入賞を果たしていました。

paizaさん、Qiitaさんありがとうございます!

GET STARTED !!!

まずトップページを読んでみます。
さらっと読んでみます。
おもしろそうです。「ワクワクすっぞっ!!」

Getting started

ページを進めます。
その通りにやればできます。

手順が古くなるかもしれませんし、公式ページの単なるコピペを書いても仕方ないので、 できました ということを書いておきます。

RustとElixirの対比

微妙に異なる部分はあるのだろうとは思いますが、Getting startedの中で出てきた用語のうち、Alchemistであるそこのあなたに向けて、Elixirで言うところの何にあたるのかを書いておきます。

Rust Elixir コメント
cargo mix プロジェクト作ったり依存関係を解決したりビルドしたりするツール(コマンド)
crates Hex ライブラリ
Cargo.toml mix.exs どのライブラリを取り込むかを書きます
https://crates.io/ https://hex.pm/ ライブラリが公開されているサイト
Rustacean Alchemist 使い手のこと
Ferris いない!? 非公認のマスコット。性別不明の蟹。 

もちろん「完全に理解しました!」

もちろん例の意味です。
Getting startedをそのままやると以下をターミナルに表示することができます。

 __________________________
< Hello fellow Rustaceans! >
 --------------------------
        \
         \
            _~^~^~_
        \) /  o o  \ (/
          '_   -   _'
          / '-----' \

Ferrisがしゃべってくれます。

せっかくなのでちょっと違うことをしてみます。
Cargo.tomlを変更してみます。

まずはGetting startedの通りに書いた場合です。

Cargo.toml
[dependencies]
ferris-says = "0.3.1"

ferris-saysは、ライブラリです。
変更をしてみます。

Cargo.toml
[dependencies]
ferris-says = { version = "0.3.1", features = ["clippy"] }

Cargo.tomlを変更したら、迷わず実行(cargo run)してみましょう!

 __________________________
< Hello fellow Rustaceans! >
 --------------------------
        \
         \
            __
           /  \
           |  |
           @  @
           |  |
           || |/
           || ||
           |\_/|
           \___

キャラクターが変わりました。
Clippy、君は一体だれ!?

GitHubで質問のやりとりを見つけました。


さいごに

RustのGET STARTEDをやってみました。
ElixirからRustに入門する方のお役に立てれば幸いわい$\huge{Y}$です。

Elixirで同じことをするGET STARTEDを書いてみようと思っています(あくまでも思っています)。

10
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?