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
550
Introducing the Jet Programming Language
i2y
3
1.1k
Other Decks in Programming
See All in Programming
Amazon Neptuneで始める初めてのグラフDB ー グラフDBを使う意味を考える ー
satoshi256kbyte
2
260
o1モデルのプロンプトエンジニアリングって?
ktc_wada
0
280
rails_girls_is_my_gate_to_join_the_ruby_commuinty
maimux2x
0
200
僕が思い描くTypeScriptの未来を勝手に先取りする
yukukotani
9
2.4k
Lessons by WebAssembly app in production on CDN Edge Computing Service
tetsuharuohzeki
0
210
Jakarta EE meets AI
ivargrimstad
1
540
マルチモジュールにおけるテスト最適化
fxwx23
0
210
Modern Angular with the NGRX Signal Store New Rules for Your Architecture @BASTA! 2024 in Mainz
manfredsteyer
PRO
0
160
What you can do with Ruby on WebAssembly
kateinoigakukun
0
170
API Platform for Laravel
dunglas
1
490
Amazon BedrockでサーバレスなAIお料理ボットを作成する!!
tosuri13
0
230
Method Swizzlingを行うライブラリにおけるマルチモジュール設計
yoshikma
0
120
Featured
See All Featured
Being A Developer After 40
akosma
84
590k
Robots, Beer and Maslow
schacon
PRO
157
8.2k
Code Review Best Practice
trishagee
62
16k
Debugging Ruby Performance
tmm1
72
12k
Learning to Love Humans: Emotional Interface Design
aarron
270
40k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
The Invisible Customer
myddelton
119
13k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
326
21k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
36
2.1k
Git: the NoSQL Database
bkeepers
PRO
425
64k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
158
15k
Clear Off the Table
cherdarchuk
91
320k
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༻ͷϓϥάΠϯΛ࡞༧ఆͰ͢ʂʢ࡞ͬͯΒ ͬͯخ͍͠Ͱ͢ʂʣ
• ࠷ऴతʹηϧϑϗεςΟϯά͍ͨ͠ɻ