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
Racc Introduction
Search
Hirofumi Wakasugi
October 25, 2017
Programming
1
430
Racc Introduction
201-10-25 Shinjuku.rb #54 言語のしくみ
Hirofumi Wakasugi
October 25, 2017
Tweet
Share
More Decks by Hirofumi Wakasugi
See All by Hirofumi Wakasugi
Keep Calm and Enjoy Gachima
5t111111
3
350
Swift Functional Programming
5t111111
0
270
Middleman on Production
5t111111
0
160
名古屋Ruby会議03 高速一言感想
5t111111
3
1k
ドキュメント翻訳懺悔のLT ~進捗ダメです~
5t111111
1
610
UFO演算子について
5t111111
0
320
Rubyと戯れるOSS DTM
5t111111
4
750
Rubyの拡張をCrystalで書いてみる
5t111111
0
110
YARV INTRODUCTION
5t111111
0
90
Other Decks in Programming
See All in Programming
Jaspr Dart Web Framework 박제창 @Devfest 2024
itsmedreamwalker
0
150
どうして手を動かすよりもチーム内のコードレビューを優先するべきなのか
okashoi
3
870
EC2からECSへ 念願のコンテナ移行と巨大レガシーPHPアプリケーションの再構築
sumiyae
3
590
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.2k
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
1.4k
traP の部内 ISUCON とそれを支えるポータル / PISCON Portal
ikura_hamu
0
180
技術的負債と向き合うカイゼン活動を1年続けて分かった "持続可能" なプロダクト開発
yuichiro_serita
0
300
Beyond ORM
77web
11
1.6k
Androidアプリの One Experience リリース
nein37
0
1.2k
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
300
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
1k
オニオンアーキテクチャを使って、 Unityと.NETでコードを共有する
soi013
0
370
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
3
180
Scaling GitHub
holman
459
140k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Testing 201, or: Great Expectations
jmmastey
41
7.2k
Gamification - CAS2011
davidbonilla
80
5.1k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
YesSQL, Process and Tooling at Scale
rocio
170
14k
How STYLIGHT went responsive
nonsquared
96
5.3k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
192
16k
Agile that works and the tools we love
rasmusluckow
328
21k
The Power of CSS Pseudo Elements
geoffreycrofte
74
5.4k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
Transcript
RACC INTRODUCTION Hirofumi Wakasugi (@5T111111)
None
3BDDͷհ RACC INTRODUCTION
ݴޠॲཧܥʹ͓͚ΔίϯύΠϥͷࣄ RACC INTRODUCTION ࣈ۟ղੳ MFYJDBMBOBMZTJT wೖྗจࣈྻΛτʔΫϯʹׂ UPLFOJ[F wࣈ۟ղੳͷػߏΛ୲͏ͷΛࣈ۟ղੳث
MFYFS ͱ͍͏ ߏจղੳ TZOUBYBOBMZTJT wτʔΫϯ͔Β"45Λߏங͢Δ wߏจղੳͷػߏΛ୲͏ͷΛߏจղੳث QBSTFS ͱ͍͏ ҙຯղੳ TFNBOUJDTBOBMZTJT wʜ ࠷దԽ DPEFPQUJNJ[BUJPO wʜ όΠφϦίʔυੜ DPEFHFOFSBUJPO wʜ
3BDDQBSTFSHFOFSBUPS RACC INTRODUCTION
ݴޠॲཧܥʹ͓͚ΔίϯύΠϥͷࣄ RACC INTRODUCTION ࣈ۟ղੳ MFYJDBMBOBMZTJT wೖྗจࣈྻΛτʔΫϯʹׂ UPLFOJ[F wࣈ۟ղੳͷػߏΛ୲͏ͷΛࣈ۟ղੳث
MFYFS ͱ͍͏ ߏจղੳ TZOUBYBOBMZTJT wτʔΫϯ͔Β"45Λߏங͢Δ wߏจղੳͷػߏΛ୲͏ͷΛߏจղੳث QBSTFS ͱ͍͏ ҙຯղੳ TFNBOUJDTBOBMZTJT wʜ ࠷దԽ DPEFPQUJNJ[BUJPO wʜ όΠφϦίʔυੜ DPEFHFOFSBUJPO wʜ
QBSTFSHFOFSBUPSͬͯԿͰ͔͢ RACC INTRODUCTION
QBSTFSHFOFSBUPSͱ RACC INTRODUCTION w ͦͷ໊ͷ௨ΓʮQBSTFSΛੜ͢Δͷʯ w QBSTFSϓϩάϥϜͰ͋Δ w QBSTFSΛ։ൃ͢Δͷ Ұൠతʹ
େม w QBSTFSʹٻΊΒΕΔػೳ ಡΈ͘͢نଇԽ͍͢͠จ๏ͱ͔-"-3ͱ͔ ൚༻త ˣ QBSTFSΛࣗಈੜ͢ΔϓϩάϥϜ͕͋Δͱศར
QBSTFSHFOFSBUPS RACC INTRODUCTION w දతͳQBSTFSHFOFSBUPSʹɺ:BDDͦͷ্Ґޓͷ(/6#JTPO͕͋Δ .3*ͷίϯύΠϥͰ#JTPOΛ͍ͬͯΔ 4FFAQBSTFZAGPSEFUBJMT w
3BDD؆୯ʹݴ͏ͱ:BDDͷ3VCZ൛ จ๏ϑΝΠϧΛॻ͘͜ͱͰίʔυͷʮߏʯΛղੳ͢Δ εΫϦϓτΛ࡞Δ ྨࣅͷͷʹ1ZUIPOͷ1-:ͳͲ͕͋Δ
ࠓ͔ΒSBDDͷ͜ͱͬͱ͘ཧ༝͋Δʁ RACC INTRODUCTION w SBDDͰάάͬͯ͋Μ·Γ࠷ۙͷهࣄ͕ώοτ͠ͳ͍ΑͶʁ ͍ΖΜͳͱ͜ΖͰΘΕͯΔ͔Β͖ͬͱؒతʹ͍ͬͯΔ QBSTFSHFN 3VCPDPQͱ͔ͰΘΕͯΔͭ
ͷQBSTFSੜSBDD SVCFYͱ͔͔ͳΓ৽͍͠HFNͰSBDD͕ΘΕͯΔ w Ͱݴޠॲཧܥ͍͡Γ͍ͨਓ͔͠ඞཁͳ͍ΑͶʁ QBSTFSѻ͑ΔΑ͏ʹͳ͓ͬͯ͘ͱศརͰ͢ ޙड़
SBDDͷจ๏ϑΝΠϧ RACC INTRODUCTION DMBT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͏ͷͷ۠ผॏཁͰ͋Δ
SBDDͷจ๏ϑΝΠϧ RACC INTRODUCTION DMBTT.Z1BSTFS SVMF JG@TUNU*'FYQSUIFOFYQSFMTF&/% UIFO5)&/ ] FMTF&-4&FYQS ]
FYQS/6.#&3 ]*%&/5 ]453*/( ǘ FOE ࠨลʹ͋Δه߸ ඇऴه߸ͱ͍ͬͯ ׂ͞ΕͨΓଞͷه߸ (ྻ) ʹஔ͞ΕΔ ඇऴه߸ҰൠతʹখจࣈͰॻ͘
SBDDͷจ๏ϑΝΠϧ RACC INTRODUCTION DMBTT.Z1BSTFS SVMF JG@TUNU*'FYQSUIFOFYQSFMTF&/% UIFO5)&/ ] FMTF&-4&FYQS ]
FYQS/6.#&3 ]*%&/5 ]453*/( ǘ FOE ӈลʹ͚ͩ͋Δه߸ ऴه߸ͱ͍ͬͯ ͦΕҎ্ׂ͞ΕͨΓ͢Δ͜ͱͳ͍ ʮ͜ͷྫͰʯͯ͢େจࣈʹͳ͍ͬͯΔ
SBDDͷจ๏ϑΝΠϧ RACC INTRODUCTION DMBTT.Z1BSTFS SVMF JG@TUNU*'FYQSUIFOFYQSFMTF&/% UIFO5)&/ ] FMTF&-4&FYQS ]
FYQS/6.#&3 ]*%&/5 ]453*/( ǘ FOE ߏจղੳ͞ΕΔτʔΫϯྻ ྫ͑࣍ͷΑ͏ͳऴه߸ͷྻͰ͋Δ IF IDENT THEN STRING ELSE NUMBER END
SBDDͷจ๏ϑΝΠϧ RACC INTRODUCTION DMBTT.Z1BSTFS SVMF JG@TUNU*'FYQSUIFOFYQSFMTF&/% UIFO5)&/ ] FMTF&-4&FYQS ]
FYQS/6.#&3 ]*%&/5 ]453*/( ǘ FOE IF IDENT THEN STRING ELSE NUMBER END ͕ IF expr then expr else END ͷه߸ʹ߹க͠ if_stmtͱͯ͠ղऍ͞ΕΔ
ߏจղੳͷྲྀΕ RACC INTRODUCTION JGGMBH ǎGMBHJTUSVF FOE
ߏจղੳͷྲྀΕ RACC INTRODUCTION JGGMBH ǎGMBHJTUSVF FOE JGGMBHǎGMBHJTUSVFǏFOE ↓
ߏจղੳͷྲྀΕ RACC INTRODUCTION JGGMBHǎGMBHJTUSVFǏFOE ↓ *'*%&/5453*/(&/%
SBDDͷจ๏ϑΝΠϧ RACC INTRODUCTION DMBTT.Z1BSTFS SVMF JG@TUNU*'FYQSUIFOFYQSFMTF&/% UIFO5)&/ ] FMTF&-4&FYQS ]
FYQS/6.#&3 ]*%&/5 ]453*/( ǘ FOE *'*%&/5453*/(&/% ȕ *'FYQSFYQS&/% ȕ *'FYQS UIFO FYQS FMTF &/% ȕ JG@TUNU
3VCZͰنଇʹର͢ΔΞΫγϣϯ͕ॻ͚Δ RACC INTRODUCTION
RACC INTRODUCTION DMBTT.Z1BSTFS SVMF JG@TUNU*'FYQSUIFOFYQSFMTF&/% \ SFTVMUJGWBM<> WBM<> FOE ^
ǘ FYQS/6.#&3 \SFTVMUWBM<>UP@J^ ]*%&/5 \SFTVMUWBM<>^ ]453*/( \SFTVMUWBM<>^ ǘ FOE valͱresultنఆͷม໊
3BDD͕ੜ͢ΔQBSTFSͷίʔυ RACC INTRODUCTION
RACC INTRODUCTION ǘ NPEVMF@FWBM QBSTFSSCZ
EFG@SFEVDF@ WBM @WBMVFT SFTVMU SFTVMUWBM<>UP@J SFTVMU FOE NPEVMF@FWBM QBSTFSSCZ EFG@SFEVDF@ WBM @WBMVFT SFTVMU SFTVMUWBM<> SFTVMU FOE NPEVMF@FWBM QBSTFSSCZ EFG@SFEVDF@ WBM @WBMVFT SFTVMU SFTVMUWBM<> SFTVMU FOE EFG@SFEVDF@OPOF WBM @WBMVFT SFTVMU WBM<> FOE ǘ େྔͷ module_eval
RACC INTRODUCTION ǘ NPEVMF@FWBM QBSTFSSCZ
EFG@SFEVDF@ WBM @WBMVFT SFTVMU SFTVMUWBM<>UP@J SFTVMU FOE NPEVMF@FWBM QBSTFSSCZ EFG@SFEVDF@ WBM @WBMVFT SFTVMU SFTVMUWBM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ΈΑ͏ RACC INTRODUCTION w 3VCZͰΞΫγϣϯ͕ॻ͚Δͷ͕खܰ μοΫλΠϐϯάϝλϓϩ͕͞Δ͜ͱ͕ଟ͍ NFUIPE@NJTTJOHͰ3VCZίʔυʹॲཧΛҠৡ͢Δͱ͔ w
ύʔαʔαΫοͱॻ͚ΔͱԿ͔ͷઃఆϚΠάϨʔγϣϯͷॻ͖ࣺͯεΫϦϓτͱ͔͕ॻ͖͘͢ͳΔ 3BDDΛͬͨOHJOYઃఆϑΝΠϧͷղੳ IUUQTRJJUBDPNGVKJTIJOJUFNTEGCGEDE w --7.ͱ͔͋Δ͠ϓϩάϥϛϯάݴޠ࡞Γ͘͢ͳͬͯΔ͔Β৭ʑָ͍͠ ͔ ͨͩ--7.ͷ3VCZCJOEJOH͜Εͱ͍ͬͨͷ͕ͳ͍ MMWN@JS@GJMFQVUT TUS ʜʁ
ޚਗ਼ௌ༗͏ޚ࠲͍·ͨ͠ RACC INTRODUCTION w ࢀߟ 3BDDͷ͍ํ IUUQJMPWFSVCZOFUKBQSPKFDUTSBDDEPDVTBHFIUNM 3VCZΛഒ͏ͨΊͷຊແಓฤ
w εϖγϟϧαϯΫε !LPJD ˢͷʮഒʙʯͷຊΛڭ͑ͯ͘Εͨ