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
1.1k
2
Share
Socket.io for Haskell folks
Ting-Yen Lai
December 08, 2013
More Decks by Ting-Yen Lai
See All by Ting-Yen Lai
Fuck FINAL
banacorn
0
190
Other Decks in Programming
See All in Programming
Offline should be the norm: building local-first apps with CRDTs & Kotlin Multiplatform
renaudmathieu
0
210
飯MCP
yusukebe
0
510
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
3
280
事業会社でのセキュリティ長期インターンについて
masachikaura
0
250
Kubernetes上でAgentを動かすための最新動向と押さえるべき概念まとめ
sotamaki0421
3
500
第3木曜LT会 #28
tinykitten
PRO
0
110
AWSコミュニティ活動は顧客のクラウド推進に効くのか / Do AWS community activities help customers adopt the cloud?
seike460
PRO
0
140
tRPCの概要と少しだけパフォーマンス
misoton665
2
210
t *testing.T は どこからやってくるの?
otakakot
1
650
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
100
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
790
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
200
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
How to train your dragon (web standard)
notwaldorf
97
6.6k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
500
Discover your Explorer Soul
emna__ayadi
2
1.1k
Prompt Engineering for Job Search
mfonobong
0
270
So, you think you're a good person
axbom
PRO
2
2k
How to make the Groovebox
asonas
2
2.1k
We Have a Design System, Now What?
morganepeng
55
8.1k
WENDY [Excerpt]
tessaabrams
10
37k
Utilizing Notion as your number one productivity tool
mfonobong
4
290
Optimising Largest Contentful Paint
csswizardry
37
3.6k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
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?