Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
fukuoka.rb#202 RustでつくるRuby
monochrome
March 24, 2021
Programming
1
240
fukuoka.rb#202 RustでつくるRuby
monochrome
March 24, 2021
Tweet
Share
More Decks by monochrome
See All by monochrome
sisshiki1969
0
35
sisshiki1969
0
82
Other Decks in Programming
See All in Programming
minodriven
39
29k
dora1998
0
190
nerocrux
3
1.7k
patrickjahr
0
130
daiki_0816
0
200
shiba6v
0
210
doyaaaaaken
1
340
kaonash
2
1.9k
quannt
1
110
hiddenest12
0
110
pco2699
0
110
kazuhei0108
3
970
Featured
See All Featured
revolveconf
201
9.7k
chriscoyier
683
180k
addyosmani
312
21k
cherdarchuk
73
270k
rocio
155
11k
samanthasiow
59
6.5k
dougneiner
119
8k
tanoku
259
24k
trallard
15
840
phodgson
88
4k
imathis
479
150k
marktimemedia
7
460
Transcript
RustでつくるRuby処理系 monochrome twitter: @s_isshiki1969 GitHub: https://github.com/sisshiki1969 Slack: プログラミング言語処理系が好きな人の集まり https://prog-lang-sys-ja-slack.github.io/wiki/
ruruby (https://github.com/sisshiki1969/ruruby) • Rust製のRuby実装 • 仮想マシンインタプリタ • 他の既存実装・仮想マシンへの依存なし • 3万行ぐらい
モチベーション 1. Rustの勉強がしたい 2. 何か言語処理系を作りたい 3. Ruby面白そう
benchmark
開発のモチベーションをいかに維持するか 1. おもちゃじゃないプログラムを動かしたい 2. 「正しく動いている」ことがわかるもの 3. 実行速度を測定できるもの 4. 極力外部ライブラリに依存しないもの
Optcarrot • Rubyで書かれたファミコンのエミュレータ • 「Ruby3x3」のための準公式ベンチマーク • ベンチマーク用の速度測定モードがある • 生成した画像の正しさをチェックサムで検証できる •
(ベンチマークモードでは)外部ライブラリを使用しない
optcarrot benchmark
None
技術的に難しかった点 • ガベージコレクタ →自作した。 • Fiber →アセンブリで実装 (x86-64/linux, aarch64/MacOS)
言語処理系自作は • モチベーションを維持する工夫が大切 • 対象言語の実行モデルの勉強になる • 楽しいので、みんなで作ろう Slack: プログラミング言語処理系が好きな人の集まり https://prog-lang-sys-ja-slack.github.io/wiki/