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
自作言語コンパイラを作った話
Search
Yuya Kono
September 19, 2020
Programming
0
180
自作言語コンパイラを作った話
OSC広島2020の学生LTで発表したスライドです。
https://github.com/takoeight0821/malgo
Yuya Kono
September 19, 2020
Tweet
Share
More Decks by Yuya Kono
See All by Yuya Kono
自作プログラミング言語Malgoの紹介
takoeight0821
0
200
プログラミングの暗黙知
takoeight0821
0
90
git logで振り返る大学4年間
takoeight0821
1
190
自作言語にモジュールを実装した話
takoeight0821
0
420
量子コンピュータで乱数を生成した話
takoeight0821
1
280
自作言語malgoのコンパイラをリファクタリングした話
takoeight0821
0
370
今日から始める自作コンパイラ ver 0.0.1
takoeight0821
0
1.1k
Language Server Protocolの話
takoeight0821
0
450
GraalVMで遊ぶ
takoeight0821
0
180
Other Decks in Programming
See All in Programming
AI Agent Dojo #4: watsonx Orchestrate ADK体験
oniak3ibm
PRO
0
120
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
1
700
Flutter On-device AI로 완성하는 오프라인 앱, 박제창 @DevFest INCHEON 2025
itsmedreamwalker
1
180
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
510
SQL Server 2025 LT
odashinsuke
0
120
Grafana:建立系統全知視角的捷徑
blueswen
0
270
まだ間に合う!Claude Code元年をふりかえる
nogu66
5
920
Navigating Dependency Injection with Metro
l2hyunwoo
1
200
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
150
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
0
550
[AtCoder Conference 2025] LLMを使った業務AHCの上⼿な解き⽅
terryu16
6
1k
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
160
Featured
See All Featured
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
40
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
300
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
330
Between Models and Reality
mayunak
1
150
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
97
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
61
47k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
220
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
270
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
42
Transcript
ࣗ࡞ݴޠίϯύΠϥΛ࡞ͬͨ ౡࢢཱେֶɹՏ༤ ʹΌʔΜʢ!UBLPFJHIUʣ 04$ౡ 1
ࣗݾհ w ౡࢢཱେֶใՊֶ෦ใֶՊՏ༤ w ʹΌʔΜʢ!UBLPFJHIUʣ w ίϯύΠϥɺಛʹؔϓϩάϥϛϯάݴޠͷ ίϯύΠϥʹؔ৺͕͋Δ w ใॲཧֶձͷ$4ྖҬྭʢʣ
w ηΩϡϦςΟɾΩϟϯϓશࠃେձ ʢ$ίϯύΠϥࣗ࡞θϛʣ 2
.BMHPݴޠͷհ 3
ࣗ࡞ݴޠ.BMHP w .JO$BNMɺ5JHFSɺ4UBOEBSE.-Λϕʔεʹͨࣗ͠࡞ݴޠʢԶݴޠʣ w ଟ૬ؔʢδΣωϦΫεʣɺؔϦςϥϧʢແ໊ؔʣɺܕਪͳͲͷ ػೳΛͭ w .JO$BNMͱ()$ͷ࣮Λࢀߟʹɺ)BTLFMMͰ࣮ w IUUQTHJUIVCDPNUBLPFJHIUNBMHP
4
.BMHPͰॻ͍ͨϑΟϘφονܭࢉϓϩάϥϜ let extern print_int : Int -> {} = "print_int"
in let extern newline : () -> {} = "newline" in let fun fib(n) : Int = if n <= 1 then 1 else fib(n - 1) + fib(n - 2) in print_int(fib(10)); newline() 5
.BMHPͷίϯύΠϧ ߏจղੳɹιʔείʔυΛจ๏ʹैͬͯղੳ͠ɺ"45Λग़ྗ ໊લղܾɹมએݴͱ༻ՕॴΛղੳ͠ɺͯ͢ͷมʹ࿈൪ΛৼΔ ܕݕࠪɹܕʹج͍ͮͯϓϩάϥϜΛݕࠪ͠ɺࣗ໌ͳόάΛࢦఠ ҥɹܕݕࠪͷใΛݩʹɺ.BMHPΛΑΓγϯϓϧͳதؒදݱʹม
࠷దԽɹ͍͔ͭ͘ͷ؆୯ͳ࠷దԽΛࢪ͢ ίʔυੜɹ--7.*3Λग़ྗ $MBOH 3VTU 4XJGUͱ͔ͰΘΕ͍ͯΔ ίϯύΠϥϑϨʔϜϫʔΫ 6
(SJ⒎ݴޠͷࢼΈ 7
ࣗ࡞ݴޠ(SJ⒎ w .BMHPίϯύΠϥͷίʔυੜ෦Λ࠶ར༻ͯ͠ɺ৽ͨͳݴޠॲཧܥΛ࡞Δ ࢼΈ w .BMHPͷઃܭɺ࣮ͰಘΒΕͨݟΛݩʹɺηϧϑϗετΛݟਾ࣮͑ͨ༻ ݴޠΛࢦͯ͠։ൃத w ԆධՁΛهड़͢ΔܰྔͳߏจɺύλʔϯϚονͱ༥߹ͨؔ͠Ϧςϥϧ ͳͲɺΑΓ৺తͳػೳΛऔΓࠐΜͰ͍Δ
8
(SJ⒎Ͱॻ͍ͨϓϩάϥϜ data Bool = False | True; if :: Bool
-> {a} -> {a} -> a; if c t f = c |> { True -> t! | False -> f! }; JGΛؔͱͯ͠ϢʔβʔఆٛͰ͖Δʂ 9
(SJ⒎Ͱॻ͍ͨϓϩάϥϜ data List a = Nil | Cons a (List
a); sum = { Nil -> Int# 0L# | (Cons (Int# x) xs) -> sum xs |> {(Int# s) -> Int# (x +# s)} } ύλʔϯϚονͱ༥߹ͨؔ͠Ϧςϥϧ ͯ͢ҥͨ͠.BMHPʹม͞ΕΔ 10