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
410
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
260
Middleman on Production
5t111111
0
160
名古屋Ruby会議03 高速一言感想
5t111111
3
1k
ドキュメント翻訳懺悔のLT ~進捗ダメです~
5t111111
1
580
UFO演算子について
5t111111
0
320
Rubyと戯れるOSS DTM
5t111111
4
740
Rubyの拡張をCrystalで書いてみる
5t111111
0
100
YARV INTRODUCTION
5t111111
0
86
Other Decks in Programming
See All in Programming
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
Jakarta EE meets AI
ivargrimstad
0
150
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.2k
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
3
700
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.2k
Jakarta EE meets AI
ivargrimstad
0
240
CSC509 Lecture 11
javiergs
PRO
0
180
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
240
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
900
subpath importsで始めるモック生活
10tera
0
320
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
2
120
Featured
See All Featured
Designing the Hi-DPI Web
ddemaree
280
34k
Become a Pro
speakerdeck
PRO
25
5k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Producing Creativity
orderedlist
PRO
341
39k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
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 DMBTT.Z1BSTFS SVMF JG@TUNU*'FYQSUIFOFY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๏ϑΝΠϧ 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<> SFTVMU FOE NPEVMF@FWBM QBSTFSSCZ E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ϣϯ͕ॻ͚Δͷ͕खܰ μοΫλΠϐϯάϝλϓϩ͕͞Δ͜ͱ͕ଟ͍ NFUIPE@NJTTJOHͰ3VCZίʔυʹॲཧΛҠৡ͢Δͱ͔ w
ύʔαʔαΫοͱॻ͚ΔͱԿ͔ͷઃఆϚΠάϨʔγϣϯͷॻ͖ࣺͯεΫϦϓτͱ͔͕ॻ͖͘͢ͳΔ 3BDDΛͬͨOHJOYઃఆϑΝΠϧͷղੳ IUUQTRJJUBDPNGVKJTIJOJUFNTEGCGEDE w --7.ͱ͔͋Δ͠ϓϩάϥϛϯάݴޠ࡞Γ͘͢ͳͬͯΔ͔Β৭ʑָ͍͠ ͔ ͨͩ--7.ͷ3VCZCJOEJOH͜Εͱ͍ͬͨͷ͕ͳ͍ MMWN@JS@GJMFQVUT TUS ʜʁ
ޚਗ਼ௌ༗͏ޚ࠲͍·ͨ͠ RACC INTRODUCTION w ࢀߟ 3BDDͷ͍ํ IUUQJMPWFSVCZOFUKBQSPKFDUTSBDDEPDVTBHFIUNM 3VCZΛഒ͏ͨΊͷຊແಓฤ
w εϖγϟϧαϯΫε !LPJD ˢͷʮഒʙʯͷຊΛڭ͑ͯ͘Εͨ