Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
プログラミング言語Rustの紹介
Search
eyener3
April 27, 2019
Programming
0
540
プログラミング言語Rustの紹介
eyener3
April 27, 2019
Tweet
Share
More Decks by eyener3
See All by eyener3
やさしい共同開発で自己組織化を目指したい..!!
eyener3
0
460
マクドナルドのマネージャーから学べたこと
eyener3
0
1.4k
日本酒をちょっとだけ 好きになって欲しい
eyener3
0
490
機械学習案件について
eyener3
0
560
はじまりの挨拶@あいなー
eyener3
0
360
Other Decks in Programming
See All in Programming
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
240
deno-redisの紹介とJSRパッケージの運用について (toranoana.deno #21)
uki00a
0
150
Is Xcode slowly dying out in 2025?
uetyo
1
190
#kanrk08 / 公開版 PicoRubyとマイコンでの自作トレーニング計測装置を用いたワークアウトの理想と現実
bash0c7
1
440
Google Agent Development Kit でLINE Botを作ってみた
ymd65536
2
190
Systèmes distribués, pour le meilleur et pour le pire - BreizhCamp 2025 - Conférence
slecache
0
110
童醫院敏捷轉型的實踐經驗
cclai999
0
190
Beyond Portability: Live Migration for Evolving WebAssembly Workloads
chikuwait
0
390
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
430
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
210
Benchmark
sysong
0
270
ASP.NETアプリケーションのモダナイズ インフラ編
tomokusaba
1
410
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
Building Adaptive Systems
keathley
43
2.6k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
22k
The Cost Of JavaScript in 2023
addyosmani
51
8.4k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.8k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Facilitating Awesome Meetings
lara
54
6.4k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Transcript
プログラミング言語Rust の紹介 すとまと
自己紹介 • 学習院大学理学部数学科2019年卒業 • 休職中 • github.com/stmtk1 • qiita.com/stmtk •
機械学習 / シミュレーション / ゲーム開発 /自作プログラミング 言語に興味あり
Rustとは • 2015年1月に正式リリース • 組み込み系、自作OS、プログラミング言語、ゲーム制作など で使われる • Better than C++になる予定
• 関数型
Rustの何がいいか • 誰もが読みやすいソースコードになる • コンパイラが優秀 • 書きやすい • メモリを消費しにくいようになっている
とりまHello World • brew install rust でインストール • cargo new
hello_worldでプロジェクト作成 • cd hello_world でプロジェクト内のフォルダへ移動 • cargo run で”hello world”という文字列が出てくる
Fizz Buzz プロジェクトを作成して、プロジェクト内のsrc/main.rsを次のように変更し実 行
三項演算子が使えない
代入に返り値がない
マクロはただの置換じゃない
マクロはただの置換じゃない
所有権とライフタイムとは
所有権によって解決する問題 • ガベージコレクションをする必要がなくなる • スマートポインタを使う必要がなくなる インスタンスを一つの変数だけに持たせて使い捨てにする
• 所有権の借用 • インスタンスのクローン 1つの変数を使いまわしたい
コンパイラについて • オプションで設定しなくても使われていない変数/関数があると 警告が出る • 変数名を間違えても、似た名前の変数を教えてくれる • LLVMを使っている
まとめ • 所有権とライフタイムがメモリの消費を抑える • マクロが優秀 • 可読性が高い • 束縛分配などが使えて書きやすい •
コンパイラ
Tutorial https://doc.rust-jp.rs/the-rust-programming-language-ja/1.6/book/ https://doc.rust-lang.org/1.3.0/book/hello-cargo.html https://doc.rust-jp.rs/book/second-edition/foreword.html