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
650
Introducing the Jet Programming Language
i2y
3
1.1k
Other Decks in Programming
See All in Programming
情報漏洩させないための設計
kubotak
5
1.3k
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
4
1.1k
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
630
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
1.3k
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
550
Alba: Why, How and What's So Interesting
okuramasafumi
0
210
2025.01.17_Sansan × DMM.swift
riofujimon
2
570
QA環境で誰でも自由自在に現在時刻を操って検証できるようにした話
kalibora
1
140
盆栽転じて家具となる / Bonsai and Furnitures
aereal
0
1.9k
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
390
[JAWS-UG横浜 #80] うわっ…今年のServerless アップデート、少なすぎ…?
maroon1st
0
110
サーバーゆる勉強会 DBMS の仕組み編
kj455
1
310
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Become a Pro
speakerdeck
PRO
26
5.1k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
Bash Introduction
62gerente
610
210k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Building an army of robots
kneath
302
45k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
98
18k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
30
2.1k
Designing for Performance
lara
604
68k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Producing Creativity
orderedlist
PRO
343
39k
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༻ͷϓϥάΠϯΛ࡞༧ఆͰ͢ʂʢ࡞ͬͯΒ ͬͯخ͍͠Ͱ͢ʂʣ
• ࠷ऴతʹηϧϑϗεςΟϯά͍ͨ͠ɻ