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
Polyglot
Search
Sau Sheong Chang
October 10, 2014
Technology
0
59
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
110
Programming Complexity
sausheong
0
800
Rollicking Ruby Robots Rule the World
sausheong
0
220
3 Things You May Not Know About The Go Template Engine
sausheong
0
280
Money, Sex and Evolution (v3)
sausheong
0
64
Developing Web Applications with Go
sausheong
7
760
Money, Sex and Evolution
sausheong
1
72
A Tale of Two Frameworks
sausheong
0
69
Ruby, Rock and Roll
sausheong
3
280
Other Decks in Technology
See All in Technology
ジョブマッチングサービスにおける相互推薦システムの応用事例と課題
hakubishin3
3
610
国土交通省 データコンペ参加者向け勉強会
takehikohashimoto
0
360
AWS パートナー企業でテクニカルサポートに従事して 3年経ったので思うところをまとめてみた
kazzpapa3
1
200
組み込みLinuxの時系列
puhitaku
3
960
Datachain会社紹介資料(2024年11月) / Company Deck
datachain
4
17k
データ活用促進のためのデータ分析基盤の進化
takumakouno
2
130
元旅行会社の情シス部員が教えるおすすめなre:Inventへの行き方 / What is the most efficient way to re:Invent
naospon
2
180
ドメイン名の終活について - JPAAWG 7th -
mikit
20
10k
Fargateを使った研修の話
takesection
0
160
Microsoft Fabric OneLake の実体について
ryomaru0825
0
180
「視座」の上げ方が成人発達理論にわかりやすくまとまってた / think_ perspective_hidden_dimensions
shuzon
2
15k
신뢰할 수 있는 AI 검색 엔진을 만들기 위한 Liner의 여정
huffon
0
530
Featured
See All Featured
BBQ
matthewcrist
85
9.3k
A better future with KSS
kneath
238
17k
Building Adaptive Systems
keathley
38
2.3k
Fireside Chat
paigeccino
33
3k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
810
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
7
520
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
390
Into the Great Unknown - MozCon
thekraken
32
1.5k
Making Projects Easy
brettharned
115
5.9k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Happy Clients
brianwarren
97
6.7k
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
[email protected]
@sausheong 21