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
Web, Concurrency, FP
Search
Oleksii Kachaiev
May 31, 2013
Programming
5
910
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
270
Talking SQL to Strangers
kachayev
3
570
Counting HTTP: 0.9...3
kachayev
1
85
Managing Data Chaos in The World of Microservices
kachayev
3
660
Deep HTTP Dive Through Aleph & Netty
kachayev
6
3.8k
Keep Your Data Safe With Refined Types
kachayev
4
1.5k
Clojure at Attendify (2nd ed)
kachayev
5
1.6k
Clojure at Attendify
kachayev
4
350
Finagle & Clojure
kachayev
6
1.3k
Other Decks in Programming
See All in Programming
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
170
CSC509 Lecture 02
javiergs
PRO
0
410
育てるアーキテクチャ:戦い抜くPythonマイクロサービスの設計と進化戦略
fujidomoe
1
150
あなたの知らない「動画広告」の世界 - iOSDC Japan 2025
ukitaka
0
390
エンジニアとして高みを目指す、 利益を生み出す設計の考え方 / design-for-profit
minodriven
23
12k
アメ車でサンノゼを走ってきたよ!
s_shimotori
0
140
メモリ不足との戦い〜大量データを扱うアプリでの実践例〜
kwzr
1
870
Go言語の特性を活かした公式MCP SDKの設計
hond0413
1
180
XP, Testing and ninja testing ZOZ5
m_seki
2
300
Advance Your Career with Open Source
ivargrimstad
0
340
2分台で1500examples完走!爆速CIを支える環境構築術 - Kaigi on Rails 2025
falcon8823
3
3.1k
CSC509 Lecture 04
javiergs
PRO
0
290
Featured
See All Featured
BBQ
matthewcrist
89
9.8k
Building Adaptive Systems
keathley
43
2.8k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
53k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
610
Facilitating Awesome Meetings
lara
56
6.6k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
How GitHub (no longer) Works
holman
315
140k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.2k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
960
Navigating Team Friction
lara
189
15k
The Invisible Side of Design
smashingmag
301
51k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
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