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
ElixirによるBEAM言語の作り方とUiroのご紹介
Search
Yasushi Itoh
April 19, 2016
Programming
0
1.6k
ElixirによるBEAM言語の作り方とUiroのご紹介
tokyo.ex #1でのLT資料
Yasushi Itoh
April 19, 2016
Tweet
Share
More Decks by Yasushi Itoh
See All by Yasushi Itoh
A Cross-Platform Pure Python Declarative UI Framework
i2y
1
610
Introducing the Jet Programming Language
i2y
3
1.1k
Other Decks in Programming
See All in Programming
距離関数を極める! / SESSIONS 2024
gam0022
0
290
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
340
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
200
Arm移行タイムアタック
qnighy
0
340
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
Jakarta EE meets AI
ivargrimstad
0
700
Micro Frontends Unmasked Opportunities, Challenges, Alternatives
manfredsteyer
PRO
0
110
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
6
1.8k
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Code Reviewing Like a Champion
maltzj
520
39k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Facilitating Awesome Meetings
lara
50
6.1k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Designing Experiences People Love
moore
138
23k
Designing the Hi-DPI Web
ddemaree
280
34k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
900
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Six Lessons from altMBA
skipperchong
27
3.5k
Transcript
ElixirʹΑΔBEAMݴޠ ͷ࡞ΓํͱUiro(Ծ)ͷ ͝հ
ࣗݾհ i2yͱਃ͠·͢ɻ ੈؒͰෳ߹ػϝʔΧʔͱͯ͠ೝ͞Εͯ ͍ΔձࣾͷιϑτΣΞΤϯδχΞͰ͢ɻ ࣄͰɺJavaC#ɺJavaScriptΛओ ʹ͍ͬͯ·͢ɻ ElixirɺErlangͱʹॳ৺ऀϨϕϧͰ ͢^^; ࠷ۙͷझຯΦϨΦϨݴޠ࡞ΓͰ͢ɻ PythonͰ࣮ͨ͠PythonʹࣅͨMochi
ͱ͍͏ݴޠΛGitHubͰެ։͍ͯ͠·͢ɻ
τʔΫ༰ ࠷ۙ࡞ͬͨUiro(Ծ)ΛྫʹBEAMݴޠͷ࡞ΓํΛ͓͠͠·͢ɻ Uiro(Ծ)RubyΆ͍จ๏ͷBEAMݴޠͰ͢ɻ ※ ࠷ޙʹRubyΛ৮ͬͨͷ13͘Β͍લͰɺRubyʹৄ͍͠༁Ͱ ͋Γ·ͤΜɻɻ
Uiro(Ծ)ͷ࡞εςοϓ ͬ͘͟Γɺ3εςοϓ 1.۩ମతͳจ๏ΛܾΊΔ ίϯύΠϥʢτϥϯεϨʔλʣΛ࣮͢Δ 2. ιʔείʔυΛߏจղੳͯ͠தؒܗࣜ(AST)ʹม͢Δ 3. தؒܗࣜ(AST)ΛBEAMͷόΠτίʔυʹม͢Δ
۩ମతͳจ๏ΛܾΊΔ Uiro(Ծ)ΛɺRubyʹࣅͨจ๏ͱ͠·ͨ͠ɻ • Rubyʹࣅͨߏจ • ཧ༝ɿErlangͱRubyʹࣅ͍ͯΔ͕͋ΓɺErlangͷػ ೳΛRubyʹϚοϐϯά͠қ͔͔ͬͨΒ ※ ڞʹؔͱม(ଋറʣͷ໊લۭؒΛ۠ผ͢ΔLisp-2ํࣜ ※
͞ΒʹErlangͷΞτϜΛRubyͷγϯϘϧ(:hoge)ͱಉ͡ هड़ͰදݱͰ͖ͦ͏
۩ମతͳจ๏ΛܾΊΔ • ΫϥεϕʔεͷΦϒδΣΫτࢦɺμοΫλΠϐϯά • ཧ༝ɿࣗଟ͘ͷਓʹೃછΈ͕͋Δ͔Βɻ • Πϯελϯεͷঢ়ଶෆม • ཧ༝ɿΦϒδΣΫτࢦ͔ͩΒͱ͍ͬͯɺՄม͕σϑΥϧτ Ͱͳ͍͍ͯ͘ͷͰɻ
Uiro(Ծ)ίʔυ͜Μͳײ͡ # Ϋϥεఆٛʢ1ϑΝΠϧʹ1Ϋϥε͘͠1ϞδϡʔϧͰ͢ʣ class Person def initialize(name, age) {name: name,
age: age} end def name() @name end end module Test_Person def test_name() hoge_san = new Person("hoge", 60) hoge_san.name # => "hoge" end end
Uiro(Ծ)ίʔυ͜Μͳײ͡ # Ϟδϡʔϧఆٛ module Enumerable def select(func) self.reduce([]) {|item, acc|
if func.(item) acc ++ [item] else acc end } end # ҎԼɺলུ end
Uiro(Ծ)ίʔυ͜Μͳײ͡ # ϛοΫεΠϯ module uiro_list include Enumerable def reduce(acc, func)
lists::foldl(func, acc, self) end # ҎԼɺলུ end module test_list def self.test_select() [1, 2, 2, 3].select {|item| item == 2 or item == 3) .unique # => [2, 3] end end
ߏจղੳͯ͠தؒܗࣜʹ leexͱyeccͷೖྗϑΝΠϧΛsrcσΟϨΫτϦʹஔ͍͓͚ͯɺ MixͰϏϧυ࣌ʹࣗಈతʹleexͱyecc͕࣮ߦ͞Ε·͢ɻ
தؒܗࣜΛBEAMͷόΠτίʔυʹ Erlangͷerl_syntaxϞδϡʔϧͱcompileϞδϡʔϧΛ͑ ɺBEAMͷόΠτίʔυΛੜ͔ΜͨΜͰ͢ɻ
࠷ޙʹ • BEAMݴޠ࡞ΔͷΧϯλϯ • ErlangElixirͱࣅ͍ͯΔݴޠɺHTMLςϯϓϨʔτ JSONͱ͍ͬͨΧϯλϯͳݴޠͳΒಛʹɻ • Elixir͍͍͢ʂ • Mixͱͯศར
࠷ޙʹ • Uiro(Ծ)ΑΖ͓͘͠ئ͍͠·͢ʂ • ϓϧϦΫͯ͠Β͑ͨΒخ͍͠Ͱ͢ʂUiro • ϩΰ΄͍͠Ͱ͢ɾɾ(Mochiʣ • MixͱReber3༻ͷϓϥάΠϯΛ࡞༧ఆͰ͢ʂʢ࡞ͬͯΒ ͬͯخ͍͠Ͱ͢ʂʣ
• ࠷ऴతʹηϧϑϗεςΟϯά͍ͨ͠ɻ