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
900
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
260
Talking SQL to Strangers
kachayev
3
550
Counting HTTP: 0.9...3
kachayev
1
77
Managing Data Chaos in The World of Microservices
kachayev
3
640
Deep HTTP Dive Through Aleph & Netty
kachayev
6
3.7k
Keep Your Data Safe With Refined Types
kachayev
4
1.4k
Clojure at Attendify (2nd ed)
kachayev
5
1.6k
Clojure at Attendify
kachayev
4
330
Finagle & Clojure
kachayev
6
1.3k
Other Decks in Programming
See All in Programming
Devinで実践する!AIエージェントと協働する開発組織の作り方
masahiro_nishimi
6
2.2k
私のRubyKaigi 2025 Kaigi Effect / My RubyKaigi 2025 Kaigi Effect
chobishiba
1
200
ts-morph実践:型を利用するcodemodのテクニック
ypresto
1
510
Feature Flag 自動お掃除のための TypeScript プログラム変換
azrsh
PRO
4
580
少数精鋭エンジニアがフルスタック力を磨く理由 -そしてAI時代へ-
rebase_engineering
0
120
OpenTelemetryで始めるベンダーフリーなobservability / Vendor-free observability starting with OpenTelemetry
seike460
PRO
0
160
TypeScript製IaCツールのAWS CDKが様々な言語で実装できる理由 ~他言語変換の仕組み~ / cdk-language-transformation
gotok365
6
340
Efficiency and Rock 'n’ Roll (Really!)
hollycummins
0
570
DevDay2025-OracleDatabase-kernel-addressing-history
oracle4engineer
PRO
6
1.6k
TypeScriptのmoduleオプションを改めて整理する
bicstone
4
400
OpenTelemetry + LLM = OpenLLMetry!?
yunosukey
2
330
tsconfigのオプションで変わる型世界
keisukeikeda
1
120
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
56
9.4k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.2k
Automating Front-end Workflow
addyosmani
1370
200k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Building an army of robots
kneath
306
45k
Building Applications with DynamoDB
mza
95
6.4k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
19
1.2k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
52
2.8k
Being A Developer After 40
akosma
91
590k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
A better future with KSS
kneath
239
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