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
50
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
78
Programming Complexity
sausheong
0
690
Rollicking Ruby Robots Rule the World
sausheong
0
210
3 Things You May Not Know About The Go Template Engine
sausheong
0
220
Money, Sex and Evolution (v3)
sausheong
0
62
Developing Web Applications with Go
sausheong
7
720
Money, Sex and Evolution
sausheong
1
65
A Tale of Two Frameworks
sausheong
0
61
Ruby, Rock and Roll
sausheong
3
270
Other Decks in Technology
See All in Technology
5分で理解するWebAssemblyのWebの外の話 PHPはマイコンの夢を見るか?
usuyuki
3
200
滑空スポーツ講習会2023 航空安全講習会 第4回 日常整備に役立ちそうな雑情報 / JSA Safety Seminar 2023 glider maintenance
jsaseminar
0
110
履歴データテーブルとの向き合い方_PHPerKaigi2024
gennei
25
6.7k
小さく始めるAnsible
stopendy
0
210
二刀流でWinActorを活用してみた話
tamai_63
0
120
書を捨てよ、現場へ出よう
nwiizo
11
8.8k
SecurityCamp2023基板作るコース講義資料/Security Camp 2023 Lecture Materials
tnishinaga
5
1.3k
[2024년 3월 세미나] 다른 회사는 퍼널 분석 어떻게 하고 있을까?
datarian
1
1.6k
理想の組織も自分たちで作ろう! ―LayerXの「全員採用」を支える文化 / How to create our own ideal team
ar_tama
6
2.2k
庁舎DX推進事例集
senryakuka
0
1.7k
Tohoku.Tech #1 「Cursorを使ったRaspberry Piの開発」by ねこまた
jun2882
0
160
Simplifying Data Analysis & Visualization with Developer Tools & AI
nitya
1
220
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
39
4.3k
Robots, Beer and Maslow
schacon
PRO
154
7.9k
The Power of CSS Pseudo Elements
geoffreycrofte
58
4.9k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3k
10 Git Anti Patterns You Should be Aware of
lemiorhan
644
57k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
242
20k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
225
51k
Rebuilding a faster, lazier Slack
samanthasiow
72
8.1k
Infographics Made Easy
chrislema
237
17k
Thoughts on Productivity
jonyablonski
57
3.7k
The Mythical Team-Month
searls
214
42k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
18
6.8k
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