Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
楽にコンパイラを書く話
Search
Yuya Kono
May 19, 2019
Programming
120
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
楽にコンパイラを書く話
Yuya Kono
May 19, 2019
More Decks by Yuya Kono
See All by Yuya Kono
自作プログラミング言語Malgoの紹介
takoeight0821
0
250
プログラミングの暗黙知
takoeight0821
0
140
git logで振り返る大学4年間
takoeight0821
1
230
自作言語にモジュールを実装した話
takoeight0821
0
460
量子コンピュータで乱数を生成した話
takoeight0821
1
320
自作言語コンパイラを作った話
takoeight0821
0
230
自作言語malgoのコンパイラをリファクタリングした話
takoeight0821
0
420
今日から始める自作コンパイラ ver 0.0.1
takoeight0821
0
1.2k
Language Server Protocolの話
takoeight0821
0
480
Other Decks in Programming
See All in Programming
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
120
プロダクトコードからライブラリの境界を見つける
elmetal
PRO
0
100
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
350
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
120
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
7
2.4k
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
130
カツオ、ご期待ください
suneo3476
0
150
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
260
FreeBSDでZabbixを動かす
kenkino
0
360
AWSに止められる覚悟してますか?
morizo_1984
2
510
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
280
Featured
See All Featured
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
How GitHub (no longer) Works
holman
316
150k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
550
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
540
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
510
Navigating Team Friction
lara
192
16k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
620
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
470
Six Lessons from altMBA
skipperchong
29
4.5k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Transcript
ָʹίϯύΠϥΛॻ͘ ʹΌʔΜʢ!UBLPFJHIUʣ
ϓϩάϥϛϯάݴޠ ࡞ͬͯ·͢
ࣗ࡞ݴޠ͋Δ͋Δ Α͋͘Δޡղฤ ͍͘͢͜͝͠ͱΛ͍ͯ͠ΔͱࢥΘΕΔ ಄͕͓͔͍͠ਓͩͱࢥΘΕΔ 3VCZ͖ͩͱࢥΘΕΔ
ࣗ࡞ݴޠ͋Δ͋Δ Α͋͘Δޡղฤ ͍͘͢͜͝͠ͱΛ͍ͯ͠ΔͱࢥΘΕΔ ಄͕͓͔͍͠ਓͩͱࢥΘΕΔ 3VCZ͖ͩͱࢥΘΕΔ ਖ਼͍͠ͷ͚ͩ ͍͘͢͝͠Θ͚Ͱͳ͍
ίϯύΠϥͱ w ݴޠ"͔Βݴޠ#ͷมϓϩάϥϜ w #ΞηϯϒϦݴޠωΠςΟϒίϯύΠϥ w "#ͷͭ͋Δɻ#BCFMͱ͔ w ෳͷมॲཧΛ࿈݁ͨ͠ͷ͕΄ͱΜͲ w
ιʔείʔυΛநߏจʹม w நߏจΛதؒදݱʹม w தؒදݱΛతίʔυʹม
ίϯύΠϥͷ͠͞ w ιʔείʔυͱతίʔυͷΪϟοϓ͕େ͖͍΄Ͳ͍͠ w $ ˠΞηϯϒϦݴޠ͍͠ w ࠷దԽίϯύΠϥ͍͠ w ߴڃݴޠͷίϯύΠϥΘΓͱ؆୯
ྫ w ύλʔϯϚον͕͋Δݴޠ͔Β$ʹม͢ΔίϯύΠϥ w $ʹม͢Εɺ࠷దԽͱ͔$ίϯύΠϥ͕ؤுͬͯ ͘ΕΔ
ύλʔϯϚονͬͯʁ type Result = Ok(int) | Err(string) match input {
Ok(value) => return value, Err(_) => error("something bad happend"), } ͜Μͳͷɻ ༩͑ΒΕͨ JOQVU ͷܗʹԠͯ͡ذ͢Δɻ 3FTVMUͷఆٛ$ʹม͠ͳ͍ͱ͍͚ͳ͍ɻ
࡞ઓ w ܕλά͖ڞ༻ମʹม͢Δ w 0Lˠ &SSˠͰλά͚͢Δ w NBUDINBUDI@UBHʹม͢Δ
ܕͷม struct Result { int tag; union { int val_0;
string val_1; }; } int Ok = 0; int Err = 1; ܕ$ʹมͰ͖ͨɻ
NBUDI@UBHʹม match_tag (input, Ok) { value = input.val_0; return value;
} else match_tag (input, Err) { _ = input.val_1; error("something bad happend"); } NBUDI@UBHୈҰҾͷUBH͕ୈೋҾʹ͚͠Εଓ͘ ϒϩοΫΛ࣮ߦ͢ΔɻJGͷѥछɻ
$ʹม struct Result { int tag; union { int val_0;
char* val_1; } }; int Ok = 0; int Err = 1; if (input.tag == Ok) { int value = input.val_0; return value; } else if (input.tag == Err) { error("something bad happened"); }
·ͱΊ w ίϯύΠϥݴޠ"͔Βݴޠ#ͷมϓϩάϥϜ w Ұؾʹతݴޠʹม͢Δͱ͍͠ɻதؒදݱΛ͏·͘ ͏ͱ͙ͬͱָʹͳΔ