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
「エンジニアインターン、どうやって取った?」準備のリアルを語るLT会 Progate BAR
akiomatic
0
100
色即是空、空即是色、データサイエンス
kamoneggi
1
240
GitHub Copilot CLIのいいところ
htkym
2
1.2k
Oxlintはいかにしてtsgolintのlint ruleを呼び出しているのか
syumai
2
1k
Moments When Things Go Wrong
aurimas
3
130
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
140
AI駆動開発で崩れていくコードベースを立て直す
kyoko_nr_nr
1
400
Why Laravel apps break—Mastering the fundamentals to keep them maintainable
kentaroutakeda
1
320
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
680
自動レビューエンジンの実装と運用 ~レビューのない世界へ~
kurukuru1999
2
300
開発体験を左右するライブラリの API 設計 - GraphQL スキーマ構築ライブラリから考える #tskaigi
izumin5210
2
1.4k
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
250
Featured
See All Featured
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
180
New Earth Scene 8
popppiees
3
2.3k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
55k
Deep Space Network (abreviated)
tonyrice
0
160
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
420
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Design in an AI World
tapps
1
220
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
310
Bash Introduction
62gerente
615
210k
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?