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
620
Introducing the Jet Programming Language
i2y
3
1.1k
Other Decks in Programming
See All in Programming
Jakarta EE meets AI
ivargrimstad
0
240
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
720
Beyond ORM
77web
3
430
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
170
Go の GC の不得意な部分を克服したい
taiyow
2
770
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.6k
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
770
Fibonacci Function Gallery - Part 1
philipschwarz
PRO
0
210
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
270
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
4
1.1k
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
88
5.7k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.3k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Thoughts on Productivity
jonyablonski
67
4.4k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
170
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
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༻ͷϓϥάΠϯΛ࡞༧ఆͰ͢ʂʢ࡞ͬͯΒ ͬͯخ͍͠Ͱ͢ʂʣ
• ࠷ऴతʹηϧϑϗεςΟϯά͍ͨ͠ɻ