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+WebAssemblyでWebアプリは作れるのか
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Nobuhito Ibaraki
May 22, 2018
Technology
0
620
Rust+WebAssemblyでWebアプリは作れるのか
Nobuhito Ibaraki
May 22, 2018
Tweet
Share
More Decks by Nobuhito Ibaraki
See All by Nobuhito Ibaraki
ノーコード編集と配信パフォーマンスを両立するコンテンツエディタの開発
niba1122
1
360
フロントエンドの動向 From Google I/O 2018
niba1122
0
3.1k
potatotips_48茨木.pdf
niba1122
0
870
Activityの背景をぼかす
niba1122
2
1.5k
Other Decks in Technology
See All in Technology
困ったCSVファイルの話
mottyzzz
2
350
Claude in Chromeで始める自律的フロントエンド開発
diggymo
1
270
AWS監視を「もっと楽する」ために
uechishingo
0
300
純粋なイミュータブルモデルを設計してからイベントソーシングと組み合わせるDeciderの実践方法の紹介 /Introducing Decider Pattern with Event Sourcing
tomohisa
1
1.3k
Exadata Database Service ソフトウェアのアップデートとアップグレードの概要
oracle4engineer
PRO
1
1.2k
ドメイン駆動セキュリティへの道しるべ
pandayumi
0
170
ソフトとハード両方いけるデータ人材の育て方
waiwai2111
1
560
SwiftDataを覗き見る
akidon0000
0
300
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
漸進的過負荷の原則
sansantech
PRO
3
320
習慣とAIと環境 — 技術探求を続ける3つの鍵
azukiazusa1
2
740
Databricks Free Edition講座 データエンジニアリング編
taka_aki
0
2.8k
Featured
See All Featured
End of SEO as We Know It (SMX Advanced Version)
ipullrank
2
3.9k
Statistics for Hackers
jakevdp
799
230k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
190
Evolving SEO for Evolving Search Engines
ryanjones
0
100
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
160
How to Think Like a Performance Engineer
csswizardry
28
2.4k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
110
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
A better future with KSS
kneath
240
18k
Transcript
Rust+WebAssemblyで Webアプリは作れるのか Meguro.es #15 Nobuhito Ibaraki @niba1122
Rustとは • Mozilla が開発 • 高速 • 安全 • 2016
年、 2017 年の Stack Overflow Developer Survey で「最も愛されて いるプログラミング言語」 で一位 (Wikipedia)
Rustとは • WebAssembly と連携 ◦ WebAssembly への コンパイルをサポート → emscripten
不要 ◦ cargo web で 簡単にビルドできる (https://github.com/kout e/cargo-web)
これだけじゃないんです
強力なマクロ • パターンマッチングを使いながら 自在に構文を拡張可能 • マクロでテンプレートエンジン を作れたりする! (maud とか )
maud (https://maud.lambda.xyz/) マクロ 言語の機能で JSX のような構文拡張が可能
Client Sideを扱う強力な ライブラリ:stdweb • Rust の中に JavaScript 風のマクロを 記述できる •
JavaScript の API を扱う インターフェース (alert とか query selector とか ) 簡単に DOM やイベントを扱える
JSXのような 構文拡張 DOMの 操作 +
Rust+WebAssemblyの フレームワークを作れるのでは?
世界初かもしれない・・・
そう甘くはなかった • 変数のライフタイムとの戦い ( コールバック実行時に変数の 生存を保証させるのが難しい ) • DOM のレンダリングと状態更新は
なんとか出来た • Component や Virtual DOM までは 実装できなかった rju(龍) (https://github.com/niba1122/rju)
自作フレームワークの実装で 四苦八苦している中・・・
yew https://github.com/DenisKolodin/yew/
yewとは • Elm や ReactJS の影響を受けた Rust フレームワーク ( 名前は
Vue.js に似てる? ) • Virtual DOM による差分更新 • Component • HTML ライクな記法 ( ちょっと癖はある )
Model 状態を持つ構造体 これに Renderable や Component トレイトを実装することで コンポーネントとしてレンダリング できる。
Template
Handle Event API Request Update State
Componentの 呼び出し
サンプルアプリ https://github.com/niba1122/rust_app
まとめ • yew を使えば Rust+WebAssembly でインタラクティブなアプリを作れる! • パフォーマンスもいいらしい https://github.com/DenisKolodin/yew/issues/5#issuecomment-354777076 •
JSer が Rust のライブラリをいきなり作るのはハード
Rust+WebAssemblyは • 型安全 • ビルドツール不要 • ハイパフォーマンス の素敵な世界です。 どなたか一緒にRustを書きましょう!
ご清聴ありがとうございました