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
400
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
560
UFO演算子について
5t111111
0
310
Rubyと戯れるOSS DTM
5t111111
4
730
Rubyの拡張をCrystalで書いてみる
5t111111
0
100
YARV INTRODUCTION
5t111111
0
83
Other Decks in Programming
See All in Programming
[PHPカンファレンス沖縄2024]「無理なくできるだけ安全に」テストもないレガシーコードをリファクタリングするテクニック
ikezoemakoto
3
130
dbt-ga4パッケージを実業務に導入してみた話
t_tokumaru_feedcorp
0
130
学生の時に開催したPerl入学式をきっかけにエンジニアが組織に馴染むために勉強会を主催や仲間と参加して職能間の境界を越えていく
ohmori_yusuke
1
140
Progressive Web Apps for Rails developers
siaw23
2
550
Why I Choose NetBeans for Jakarta EE
ivargrimstad
0
290
タイミーにおけるデータの利用シーンと データ基盤の挑戦
marufeuille
4
3.2k
クラウドサービスの 利用コストを削減する技術 - 円安の真南風を感じて -
pyama86
3
400
"noncopyable types" の使いどころについて考えてみた
andpad
0
160
RDBの世界をぬりかえていくモデルグラフDB〜truncus graphによるモデルファースト開発〜
jurabi
0
170
DjangoNinjaで高速なAPI開発を実現する
masaya00
0
520
ビット演算の話 / Let's play with bit operations
kaityo256
PRO
4
180
선언형 UI를 학습할 때 알아둬야하는 키워드들
l2hyunwoo
0
150
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
31
2.8k
Git: the NoSQL Database
bkeepers
PRO
425
64k
Into the Great Unknown - MozCon
thekraken
31
1.4k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
41
9.2k
KATA
mclloyd
28
13k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
231
17k
Designing for Performance
lara
604
68k
Atom: Resistance is Futile
akmur
261
25k
Code Reviewing Like a Champion
maltzj
519
39k
Building Your Own Lightsaber
phodgson
102
6k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
27
1.9k
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@TUN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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<> SFTVMU FOE NPEVMF@FW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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 ˢͷʮഒʙʯͷຊΛڭ͑ͯ͘Εͨ