Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Polyglot
Sau Sheong Chang
October 10, 2014
Technology
0
29
Polyglot
How To Write A Web App in 6 Programming Languages
Sau Sheong Chang
October 10, 2014
Tweet
Share
More Decks by Sau Sheong Chang
See All by Sau Sheong Chang
Genetic Algorithms with Go
sausheong
0
63
Programming Complexity
sausheong
0
500
Rollicking Ruby Robots Rule the World
sausheong
0
200
3 Things You May Not Know About The Go Template Engine
sausheong
0
120
Money, Sex and Evolution (v3)
sausheong
0
53
Developing Web Applications with Go
sausheong
7
660
Money, Sex and Evolution
sausheong
1
54
A Tale of Two Frameworks
sausheong
0
57
Ruby, Rock and Roll
sausheong
3
270
Other Decks in Technology
See All in Technology
誰が正解を知っているのか / Who knows the right answer
takaking22
1
250
Custom AppをIP制限ありのままで審査に通す方法
yusuga
0
680
UWBを使ってみた
norioikedo
0
420
覗いてみよう!現場のスクラムチーム
tkredman
0
1.1k
miisan's career talk
mii3king
0
220
データエンジニアリングの潮流を俯瞰する
tetsuroito
1
740
What's Data Lake ? Azure Data Lake best practice
ryomaru0825
2
750
データをモデリングしていたら、組織をモデリングし始めた話 / engineers-in-carta-vol3-data-engineer
pei0804
4
3.3k
20220622_FinJAWS_あのときにAWSがあったらこうできた
taketakekaho
0
110
SI企業が「アジャイル推し」になったら 幸せになれますか?/Can SI company be happy if it becomes “Agile stan” ?
chinmo
1
1.2k
【toranoana.deno#7】Denoからwasmを呼び出す基礎
toranoana
0
130
LINEのB2Bプラットフォームにおけるトラブルシューティング2選
line_developers
PRO
4
300
Featured
See All Featured
What's new in Ruby 2.0
geeforr
336
30k
The Straight Up "How To Draw Better" Workshop
denniskardys
225
120k
Gamification - CAS2011
davidbonilla
75
3.9k
Documentation Writing (for coders)
carmenhchung
48
2.6k
Practical Orchestrator
shlominoach
178
8.6k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
15
940
A designer walks into a library…
pauljervisheath
196
16k
Embracing the Ebb and Flow
colly
73
3.4k
JazzCon 2018 Closing Keynote - Leadership for the Reluctant Leader
reverentgeek
172
8.4k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
181
15k
BBQ
matthewcrist
74
7.9k
Typedesign – Prime Four
hannesfritz
34
1.4k
Transcript
Polyglot Or How To Write A Web App in 6
Programming Languages Chang Sau Sheong Oct 2014 1
* http://spectrum.ieee.org/computing/software/top-‐10-‐programming-‐languages 2
*http://blog.codeeval.com/codeevalblog/2014 3
Programming language wars 4
Dependency hell 5
Polyglot 6
Build your web app with any language 7
All at once 8
Acceptor HTTP Responder Responder Responder POST/_/post Responder Responder Responder GET/_/posts
Acceptor HTTP Acceptor HTTP Broker ZMQ ZMQ Responder Responder Responder GET/_/post/new 9
10 Acceptor P
11 P Broker
12 Responder You need to write this
Simple responder require 'securerandom' require 'bundler' Bundler.require broker = "tcp://localhost:4321"
routeid = "GET/_/hello/ruby" identity = SecureRandom.uuid puts "#{routeid} - #{identity} responder ready." ctx = ZMQ::Context.new client = ctx.socket ZMQ::REQ client.identity = identity client.connect broker client.send_string routeid loop do request = String.new client.recv_string request response = [routeid, "200", "{\"Content-Type\": \"text/html\"}", "Hello World"] client.send_strings response end Define route ID and unique responder identity Connect to broker Register responder Receive request and process it Return with response 13
Distributed by default 14
15 Broker Acceptor Responder Responder Responder
Scale as you like it 16
17 Broker Acceptor Responder Responder Responder Acceptor Responder
Evolve your web app 18
19 Broker Acceptor Responder Responder Responder
Still Evolving (need your feedback and help) 20
http://github.com/sausheong/polyglot sausheong@gmail.com @sausheong 21