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
110
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
130
git logで振り返る大学4年間
takoeight0821
1
220
自作言語にモジュールを実装した話
takoeight0821
0
460
量子コンピュータで乱数を生成した話
takoeight0821
1
320
自作言語コンパイラを作った話
takoeight0821
0
220
自作言語malgoのコンパイラをリファクタリングした話
takoeight0821
0
410
今日から始める自作コンパイラ ver 0.0.1
takoeight0821
0
1.1k
Language Server Protocolの話
takoeight0821
0
480
Other Decks in Programming
See All in Programming
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
140
How I Stole PSI from Android Studio - DroidKaigi2026
worker8
0
130
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
1.8k
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
390
Webの地図
yosuke_furukawa
PRO
6
4.5k
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
1
460
App Intentsのビルドプロセスを支える技術
kntkymt
0
370
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
1
150
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
370
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
620
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
4
2.4k
kubernetes コンポーネント開発入門 / 新卒N年目の勉強会&交流会!〜〇〇への誘い〜 #n_study
mazrean
0
240
Featured
See All Featured
Exploring anti-patterns in Rails
aemeredith
4
510
Utilizing Notion as your number one productivity tool
mfonobong
4
590
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Building Adaptive Systems
keathley
44
3.2k
The SEO Collaboration Effect
kristinabergwall1
1
560
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
500
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
490
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Designing for humans not robots
tammielis
254
26k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
650
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 Ұؾʹతݴޠʹม͢Δͱ͍͠ɻதؒදݱΛ͏·͘ ͏ͱ͙ͬͱָʹͳΔ