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
Socket.io for Haskell folks
Search
Ting-Yen Lai
December 08, 2013
Programming
2
980
Socket.io for Haskell folks
Ting-Yen Lai
December 08, 2013
Tweet
Share
More Decks by Ting-Yen Lai
See All by Ting-Yen Lai
Fuck FINAL
banacorn
0
170
Other Decks in Programming
See All in Programming
AIの弱点、やっぱりプログラミングは人間が(も)勉強しよう / YAPC AI and Programming
kishida
6
3.5k
自動テストのアーキテクチャとその理由ー大規模ゲーム開発の場合ー
segadevtech
2
940
知られているようで知られていない JavaScriptの仕様 4選
syumai
0
400
Amazon Bedrock Knowledge Bases Hands-on
konny0311
0
140
仕様がそのままテストになる!Javaで始める振る舞い駆動開発
ohmori_yusuke
3
1.3k
Register is more than clipboard
satorunooshie
1
450
例外処理を理解して、設計段階からエラーを見つけやすく、起こりにくく #phpconfuk
kajitack
12
5.7k
SidekiqでAIに商品説明を生成させてみた
akinko_0915
0
130
イベントストーミングのはじめかた / Getting Started with Event Storming
nrslib
1
200
Private APIの呼び出し方
kishikawakatsumi
2
830
Agentに至る道 〜なぜLLMは自動でコードを書けるようになったのか〜
mackee
4
510
外接に惑わされない自システムの処理時間SLIをOpenTelemetryで実現した話
kotaro7750
0
240
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
36
7k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
A Tale of Four Properties
chriscoyier
161
23k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Building Applications with DynamoDB
mza
96
6.7k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Docker and Python
trallard
46
3.6k
Building an army of robots
kneath
306
46k
The Cult of Friendly URLs
andyhume
79
6.7k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
How to train your dragon (web standard)
notwaldorf
97
6.4k
Transcript
Socket.IO for Haskell Folks
None
None
None
Real-time Applications
Regular HTTP
Polling
Long-Polling
EventSource
WebSocket
WebSocket
“TCP for the web”
PROS Bi-directional + Full-duplex ! Lower overhead ! Port 80
CONS Not widely supported ! Still a draft*
Socket.IO
asdf
“The cross-browser cross-device WebSocket”
Browser Support IE 5.5+ Safari 2+ Google Chrome 4+ Firefox
3+ Opera 10.61+
Transport Support WebSocket Flash Socket AJAX long polling AJAX multipart
Forever iframe JSONP Polling
socket.emit(‘news’, ‘hey!’); ! ! ! Server
socket.on(‘news’, function (data) { console.log(data); // hey! }); ! Client
socket.emit(‘news’, ‘hey!’); ! socket.on(‘ping’, function () { socket.emit(‘pong’); }); Server
socket.on(‘news’, function (data) { console.log(data); // hey! }); ! socket.emit(‘ping’);
Client
Originated from Node.js
Now also available in many other languages Erlang Java Lua
Python Perl Go C++ C Objective-C Haxe Ruby PHP
Except for Haskell
None
socketio-0.1.0
None
socket.emit(‘news’, ‘hey!’); ! socket.on(‘ping’, function () { socket.emit(‘pong’); });
emit “news” [“hey!”] ! on “ping” $ emit “pong” []
Transport Support WebSocket (80%) Flash Socket AJAX long polling AJAX
multipart Forever iframe JSONP Polling
Difficulties
Transport Support ಠ~ಠ
Transport Support WebSocket Flash Socket AJAX long polling AJAX multipart
Forever iframe JSONP Polling
Transport Support WebSocket Flash Socket AJAX long polling AJAX multipart
Forever iframe JSONP Polling
“Premature optimization is the root of all evil”
Monad Transformers ಠ~ಠ
None
None
! KEEP CALM AND JUST USE IT
None
Iteratee I/O ಠ~ಠ
None
None
None
None
String/Text/ByteString ಠ~ಠ
None
{-# LANGUAGE OverloadedStrings #-}
Open Source Community ಠ~ಠ
None
None
Originated from Node.js
Cabal Hell ಠ~ಠ
> cabal uninstall cabal: unrecognised command: uninstall (try --help)
None
cabal-dev?
LIVE DEMO
None
http://banacorn.org:3000
None
TODO
cabal-dev?
banacorn/socket.io-haskell ! ! ! ALL CONTRIBUTIONS ARE WELCOME!
THANKS! Questions?