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
960
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
160
Other Decks in Programming
See All in Programming
令和最新版手のひらコンピュータ
koba789
14
8k
ワープロって実は計算機で
pepepper
2
1.4k
Jakarta EE Core Profile and Helidon - Speed, Simplicity, and AI Integration
ivargrimstad
0
210
TanStack DB ~状態管理の新しい考え方~
bmthd
2
340
自作OSでDOOMを動かしてみた
zakki0925224
1
1.4k
LLMOpsのパフォーマンスを支える技術と現場で実践した改善
po3rin
8
990
Namespace and Its Future
tagomoris
6
530
画像コンペでのベースラインモデルの育て方
tattaka
3
1.9k
Azure SRE Agentで運用は楽になるのか?
kkamegawa
0
110
CSC305 Summer Lecture 12
javiergs
PRO
0
130
[FEConf 2025] 모노레포 절망편, 14개 레포로 부활하기까지 걸린 1년
mmmaxkim
0
1.1k
MLH State of the League: 2026 Season
theycallmeswift
0
160
Featured
See All Featured
Become a Pro
speakerdeck
PRO
29
5.5k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
A designer walks into a library…
pauljervisheath
207
24k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
Music & Morning Musume
bryan
46
6.7k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
358
30k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
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?