$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Web, Concurrency, FP
Search
Oleksii Kachaiev
May 31, 2013
Programming
5
920
Web, Concurrency, FP
Hotcode, 2013
Oleksii Kachaiev
May 31, 2013
Tweet
Share
More Decks by Oleksii Kachaiev
See All by Oleksii Kachaiev
Counting HTTP with QUIC & HTTP/3
kachayev
2
290
Talking SQL to Strangers
kachayev
3
590
Counting HTTP: 0.9...3
kachayev
1
97
Managing Data Chaos in The World of Microservices
kachayev
3
670
Deep HTTP Dive Through Aleph & Netty
kachayev
6
3.9k
Keep Your Data Safe With Refined Types
kachayev
4
1.5k
Clojure at Attendify (2nd ed)
kachayev
5
1.7k
Clojure at Attendify
kachayev
4
360
Finagle & Clojure
kachayev
6
1.4k
Other Decks in Programming
See All in Programming
これならできる!個人開発のすゝめ
tinykitten
PRO
0
130
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
39
26k
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
440
認証・認可の基本を学ぼう後編
kouyuume
0
250
AIエージェントの設計で注意するべきポイント6選
har1101
5
2.2k
開発に寄りそう自動テストの実現
goyoki
2
1.4k
안드로이드 9년차 개발자, 프론트엔드 주니어로 커리어 리셋하기
maryang
1
130
The Art of Re-Architecture - Droidcon India 2025
siddroid
0
120
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
140
ゲームの物理 剛体編
fadis
0
370
クラウドに依存しないS3を使った開発術
simesaba80
0
150
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
350
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Automating Front-end Workflow
addyosmani
1371
200k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
50
42k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
0
44
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Agile that works and the tools we love
rasmusluckow
331
21k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
400
The agentic SEO stack - context over prompts
schlessera
0
560
We Are The Robots
honzajavorek
0
120
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
130
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
71
Designing Experiences People Love
moore
143
24k
Transcript
Web, Concurrency, FP the problems that we can’t ignore ...
any more (c) Alexey Kachayev, 2013
About me Alexey Kachayev •CTO at Attendify •Open source activist
(Fn.py) •Functional programming advocate •Erlang, Python, Scala, Clojure, Haskell, Go hacker
Contacts •kachayev <$> twitter •kachayev <$> gmail •kachayev <$> github
Disclaimer #1 It’s hard to tell “is this language functional?”
We will talk about: Erlang, Scala, Clojure, Haskell
Disclaimer #2 Web is only one way to communicate. We
will talk “mostly” about web. I assume that you know what “Web” is. Note, that it changes really fast.
Modern web challenges •real-time notifications •chats and other RT messaging
systems •real-time activity stream •collaborative documents editing •task board for team •multi-player Bomberman (* or your favorite game)
Concurrency... Concurrency is the composition of independently executing computations. Concurrency
is a way to structure software, ... (c) Rob Pike “Concurrency is not parallelism”
Concurrency is hard when independent computations depend on each other
WTF??? how independent computations can depend on each other?
Why should I care? I’m just coding Python/Ruby/PHP/ Node.js...
Classical web dev •Many OS processes •Database to store data
•.... •You are welcome in the world of concurrency!
So what? •Race condition on your data •Real-time is hard
(databases are not designed for this) •Leaking abstractions •Independency is expensive •No tests •No control
Java & .NET web dev •Threads instead of processes (VM
as OS???) •You can use memory for data collaboration •Necessity to control access to shared data leads you to locks/ mutex/semaphores
So what? •Independency is still too expensive •Still hard to
test •Still hard to control •Locks are not so good abstraction
Event- driven web dev •Single-thread environment •Event-based context switching loop
•Not so “independent” as we want •Errors are hard to manage •It’s hard to keep code simple to read
Do you need more problems? •request-reply doesn’t work (almost at
all) •concurrency is hard •fault-tolerance is hard •vertical scaling is hard (as well as horizontal) •everything should have been done yesterday
How to deal with concurrency?
Story about developers and tasks board •Locks: what is locks
and why it’s not a good idea? •Message passing: how to communicate and what are the benefits? •STM: how to collaborate efficiently and not lose control?
From theory to practice
Concurrency •Erlang •Scala •others •Clojure •Haskell •others Communication Collaboration And
why do FP “features” matter?
Erlang •message-passing concurrency •multi-core support •distributed systems •“super” stable VM
(VM as OS!) •“hard to break” something •interactive development
Scala • JVM based, high performance • (mostly) functional paradigm
• expressive type system (ADT & TI) • “less code with more results” • message-passing concurrency (prev. Akka) • ... XML is native Scala type
Reactivity or “super- thin” client •Liftweb (Scala) •Nitrogen (Erlang) •N2O
(Erlang)
Clojure •FP, lisp-family •STM concurrency model •modern language •interactive development
•macros •JavaScript compiler •huge web stack
Haskell •FP, “ML-family” •green threads and STM •expressive type system
•high level of code modularity and composability •compact declarative syntax •compile-time program verification
IWBYP http://iwbyp.chris-granger.com/
How to start? •do not wait! •do not hesitate! •do
not panic!!! •do something simple •do something interesting •find problem (pain?) and solve it
Links • https://github.com/extend/cowboy • http://nitrogenproject.com/ • http://liftweb.net/ • https://github.com/twitter/finagle •
http://www.scalatra.org/ • https://github.com/ring-clojure/ring • https://github.com/weavejester/ compojure • http://pedestal.io/ • http://himera.herokuapp.com/ synonym.html • http://snapframework.com/
Questions? * other talks: https://kachayev.github.com/talks ** me: http://twitter.com/kachayev P.S. We
are hiring