snakes on the web
Post on 18-Oct-2014
9.054 views
DESCRIPTION
The history and future of Python web development. A talk given at PyCon Argentina and PyCon Brazil, 2009.TRANSCRIPT
Snakes on the Web:
Jacob Kaplan-Mosshttp://jacobian.org/TO
The history and future of Python on the web
http://www.flickr.com/photos/kejhu/3751877257
Web development sucks.
“”
How can I make this suck less?
1. What sucks now?
2. How will we fix it?
3. Can we fix it with Python?
In the beginning…
http://www.flickr.com/photos/tonythemisfit/2904911703
Hand-rolled HTML“The Stone Age”
The Stone Age
http://www.flickr.com/photos/schoschie/3421072476/
Suck.
“”
What if we didn’t have to write
HTML by hand?
CGI“The Bronze Age”
Suck.
“”
How can we make CGI better?
(Not really a big question.)
http://www.flickr.com/photos/randomurl/446209957/
PHP“The Iron Age”
Same idea, (slightly) better tech.
http://www.flickr.com/photos/jerhoyet/2377140741
Page-oriented
http://www.flickr.com/photos/just_jump/2972461681
“”
“What if we thought of these as applications,
not pages?”
Frameworks“The Industrial Revolution”
The modern web framework:
High-level
http://www.flickr.com/photos/nikonvscanon/2128705916
Application-oriented
http://www.flickr.com/photos/joelaz/2868356069
Large building blocks
http://www.flickr.com/photos/ppdigital/2329405081/
Rapid development
http://www.flickr.com/photos/jasephotos/2913135232/
Fun!
http://www.flickr.com/photos/nattu/1190083977
What’s next?
What sucks?
Interoperability sucks.
Frameworks: good.http://www.flickr.com/photos/amberandclint/3266859324/
Lock-in: bad!
http://www.flickr.com/photos/striatic/2191404675/
Rule 1:Don’t piss off your users.
Software becomes domain-specific.
Cede control gracefully.
http://www.flickr.com/photos/aidan_jones/3575000735
Framework inter-op:
http://www.flickr.com/photos/kpwerker/421386062/
Django’s not helping.
http://www.flickr.com/photos/mafleen/1694900141/
WSGI sucks.
http://www.flickr.com/photos/jacobian/408227408
Rack’s better.http://www.flickr.com/photos/lependu/3563742168/
Gateway ≠ API
Inter-language inter-op:
VMs, Proxies, SOA, ROA, …
Gateway ≠ API !
This’ll be hard to fix
http://www.flickr.com/photos/vgm8383/2381791019/
Disparate, mostly volunteer
communities.
Little overlap.
Rich applications suck.
HTML 5
The best thing to happen to web frameworks?
Current frameworks don’t fit.
http://www.flickr.com/photos/oskay/156280584/
State of the art:
1. Parallel MVC stacksLots of work to keep in sync.
2. Coupled frameworks(GWT, Cappuccino, SproutCore)
☹
280slides
Create beautiful presentations, access them from anywhere, and share them with the world. With 280 Slides,
there's no software to download and nothing to pay for – and when you're done building your presentation you can
share it any way you like.
280 Slides:a site so complicated it needed a new language!
Python?
Deployment sucks.
Writing the app is easy…
The rest is hard!
• API Metering• Backups & Snapshots• Counters• Cloud/Cluster Management Tools
• Instrumentation/Monitoring • Failover• Node addition/removal and hashing• Auto-scaling for cloud resources
• CSRF/XSS Protection• Data Retention/Archival• Deployment Tools
• Multiple Devs, Staging, Prod• Data model upgrades• Rolling deployments• Multiple versions (selective beta)• Bucket Testing• Rollbacks• CDN Management
• Distributed File Storage
• Distributed Log storage, analysis• Graphing• HTTP Caching• Input/Output Filtering• Memory Caching• Non-relational Key Stores• Rate Limiting• Relational Storage• Queues• Rate Limiting• Real-time messaging (XMPP)• Search
• Ranging• Geo
• Sharding• Smart Caching
• Dirty-table management
http://randomfoo.net/2009/01/28/infrastructure-for-modern-web-sites
Lots of pieces
http://www.flickr.com/photos/restlessglobetrotter/448362507/
Huge opportunity
http://www.flickr.com/photos/nuclearsummer/2665337803/
Python’s been a very good glue language…
It could be again.
Scaling sucks.
Web audiences
Complexity
Traffic
Generic doesn’t scale.
Simple Complex
Generic
S
pecifi
c
Simple Complex
Generic
S
pecifi
c
My first blog
Simple Complex
Generic
S
pecifi
c
My first blog
Public launch
Simple Complex
Generic
S
pecifi
c
My first blog
Public launch
Average site
Simple Complex
Generic
S
pecifi
c
My first blog
Public launch
Average site
Simple Complex
Generic
S
pecifi
c
My first blog
Public launch
Average site
Fra
mew
ork
s
Most sites aren’t big.
What do we do?http://www.flickr.com/photos/b-tal/163450213/
Concurrency sucks.
All roads lead to multi-core.
http://www.flickr.com/photos/marc_buehler/3053243413
I’m scared.http://www.flickr.com/photos/amatuer_44060/2831112854/
Nehalem
UltraSPARC T2
128 hardware threads
128 threads
Ted thinks we’re screwed
http://www.flickr.com/photos/daninrgb/3406117892
StartServers128
I don’t think so.
Lots of exciting work in concurrency today:
ActorsSTM
Persistent data structuresDataflow
Tuple spaces
Ted Leung,A survey of concurrency constructs
http://tinyurl.com/mmbqe6
ScalaErlangClojureHaskell
Python?
Unladen Swallow?
No more GIL!
No more GIL?
Better threads.http://www.flickr.com/photos/splityarn/3469596708/
Threading sucks.
http://www.flickr.com/photos/sillydog/9844703/
I want actors!(Or STM, or whatever.)
Help!http://www.flickr.com/photos/zaia/3475695085
2020
I want to be using Python!
Let’s make Python kick ass in 2020.
“”
Good software takes ten years. Get used to it.
— Joel Spolskyhttp://tinyurl.com/ca4pr
So we need to start now.
1. Better inter-op.
WSGI 2
Django needs to do better.
We need leaders.http://www.flickr.com/photos/salimfadhley/26306549
A BDFL?
http://www.flickr.com/photos/psd/3649586425/
2. Get in front of HTML 5.
3. Rethink web development, again.
Pages
Applications
Sites
Full deployment stack, highly integrated,
centered around WSGI 2?
Yes, please!
4. Scale from day 1.
Be skeptical.http://www.flickr.com/photos/colorblindpicaso/2747637336
Plan to be replaced.
http://www.flickr.com/photos/taurusaficionado/2099239684
Holy crap please give me better concurrency!
Thank you!
Me: Jacob Kaplan-Moss
This talk: http://jacobian.org/TO
Email: [email protected]
Twitter: @jacobian