Snakes on the Web:
The history and future of Python on the web




Jacob Kaplan-Moss
http://jacobian.org/TO



           ...
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
http://www.flickr.com/photos/ppdigital/2329405081/




Large building blocks
http://www.flickr.com/photos/jasephotos/2913135232/




Rapid development
http://www.flickr.com/photos/nattu/1190083977




                                               Fun!
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 !
http://www.flickr.com/photos/vgm8383/2381791019/




This’ll be hard to fix
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 stacks
     Lots 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,
ther...
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                                         •   Distributed Log storage, analysis
•   Backups & Snapshots    ...
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.
Generic   Specific




Simple
Complex
Specific
Generic




                   My first blog



          Simple                  Complex
Specific
Generic




                                  Public launch
                   My first blog



          Simple   ...
Specific




                                                  Average site
Generic




                                  P...
Specific
                                                           Twitter




                                           ...
Specific
                                                           Twitter




                                           ...
Most sites aren’t big.
http://www.flickr.com/photos/b-tal/163450213/




What do we do?
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
http://www.flickr.com/photos/daninrgb/3406117892




                                  Ted thinks we’re screwed
StartServers
128
I don’t think so.
Lots of exciting work
in concurrency today:
Actors
           STM
Persistent data structures
        Dataflow
      Tuple spaces
Ted Leung,
A survey of concurrency constructs
        http://tinyurl.com/mmbqe6
Scala
Erlang
Clojure
Haskell
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 Spolsky
                              ...
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
http://www.flickr.com/photos/psd/3649586425/




A BDFL?
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: jacob@jacobian.org
 Twitter: @jacobian
Snakes on the Web
Snakes on the Web
Snakes on the Web
Snakes on the Web
Upcoming SlideShare
Loading in...5
×

Snakes on the Web

7,972

Published on

The history and future of Python web development. A talk given at PyCon Argentina and PyCon Brazil, 2009.

Published in: Technology, Lifestyle

Transcript of "Snakes on the Web"

  1. 1. Snakes on the Web: The history and future of Python on the web Jacob Kaplan-Moss http://jacobian.org/TO http://www.flickr.com/photos/kejhu/3751877257
  2. 2. Web development sucks.
  3. 3. “ How can I make this suck less? ”
  4. 4. 1. What sucks now? 2. How will we fix it? 3. Can we fix it with Python?
  5. 5. In the beginning… http://www.flickr.com/photos/tonythemisfit/2904911703
  6. 6. Hand-rolled HTML “The Stone Age”
  7. 7. The Stone Age http://www.flickr.com/photos/schoschie/3421072476/
  8. 8. Suck.
  9. 9. “ What if we didn’t have to write HTML by hand? ”
  10. 10. CGI “The Bronze Age”
  11. 11. Suck.
  12. 12. “ How can we make CGI better? ”
  13. 13. (Not really a big question.) http://www.flickr.com/photos/randomurl/446209957/
  14. 14. PHP “The Iron Age”
  15. 15. Same idea, (slightly) better tech. http://www.flickr.com/photos/jerhoyet/2377140741
  16. 16. Page-oriented http://www.flickr.com/photos/just_jump/2972461681
  17. 17. “ “What if we thought of these as applications, not pages?” ”
  18. 18. Frameworks “The Industrial Revolution”
  19. 19. The modern web framework:
  20. 20. High-level http://www.flickr.com/photos/nikonvscanon/2128705916
  21. 21. Application-oriented http://www.flickr.com/photos/joelaz/2868356069
  22. 22. http://www.flickr.com/photos/ppdigital/2329405081/ Large building blocks
  23. 23. http://www.flickr.com/photos/jasephotos/2913135232/ Rapid development
  24. 24. http://www.flickr.com/photos/nattu/1190083977 Fun!
  25. 25. What’s next?
  26. 26. What sucks?
  27. 27. Interoperability sucks.
  28. 28. Frameworks: good. http://www.flickr.com/photos/amberandclint/3266859324/
  29. 29. Lock-in: bad! http://www.flickr.com/photos/striatic/2191404675/
  30. 30. Rule 1: Don’t piss off your users.
  31. 31. Software becomes domain-specific.
  32. 32. Cede control gracefully. http://www.flickr.com/photos/aidan_jones/3575000735
  33. 33. Framework inter-op: http://www.flickr.com/photos/kpwerker/421386062/
  34. 34. Django’s not helping. http://www.flickr.com/photos/mafleen/1694900141/
  35. 35. WSGI sucks. http://www.flickr.com/photos/jacobian/408227408
  36. 36. Rack’s better. http://www.flickr.com/photos/lependu/3563742168/
  37. 37. Gateway ≠ API
  38. 38. Inter-language inter-op:
  39. 39. VMs, Proxies, SOA, ROA, …
  40. 40. Gateway ≠ API !
  41. 41. http://www.flickr.com/photos/vgm8383/2381791019/ This’ll be hard to fix
  42. 42. Disparate, mostly volunteer communities.
  43. 43. Little overlap.
  44. 44. Rich applications suck.
  45. 45. HTML 5
  46. 46. The best thing to happen to web frameworks?
  47. 47. Current frameworks don’t fit. http://www.flickr.com/photos/oskay/156280584/
  48. 48. State of the art:
  49. 49. 1. Parallel MVC stacks Lots of work to keep in sync.
  50. 50. 2. Coupled frameworks (GWT, Cappuccino, SproutCore)
  51. 51.
  52. 52. 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.
  53. 53. 280 Slides: a site so complicated it needed a new language!
  54. 54. Python?
  55. 55. Deployment sucks.
  56. 56. Writing the app is easy…
  57. 57. The rest is hard!
  58. 58. • API Metering • Distributed Log storage, analysis • Backups & Snapshots • Graphing • Counters • HTTP Caching • Cloud/Cluster Management Tools • Input/Output Filtering • Instrumentation/Monitoring • Memory Caching • Failover • Non-relational Key Stores • Node addition/removal and hashing • Rate Limiting • Auto-scaling for cloud resources • Relational Storage • CSRF/XSS Protection • Queues • Data Retention/Archival • Rate Limiting • Deployment Tools • Real-time messaging (XMPP) • Multiple Devs, Staging, Prod • Search • Data model upgrades • Ranging • Rolling deployments • Geo • Multiple versions (selective beta) • Sharding • Bucket Testing • Smart Caching • Rollbacks • Dirty-table management • CDN Management • Distributed File Storage http://randomfoo.net/2009/01/28/infrastructure-for-modern-web-sites
  59. 59. Lots of pieces http://www.flickr.com/photos/restlessglobetrotter/448362507/
  60. 60. Huge opportunity http://www.flickr.com/photos/nuclearsummer/2665337803/
  61. 61. Python’s been a very good glue language…
  62. 62. It could be again.
  63. 63. Scaling sucks.
  64. 64. Web audiences
  65. 65. Complexity
  66. 66. Traffic
  67. 67. Generic doesn’t scale.
  68. 68. Generic Specific Simple Complex
  69. 69. Specific Generic My first blog Simple Complex
  70. 70. Specific Generic Public launch My first blog Simple Complex
  71. 71. Specific Average site Generic Public launch My first blog Simple Complex
  72. 72. Specific Twitter Average site Generic Public launch My first blog Simple Complex
  73. 73. Specific Twitter Frameworks Average site Generic Public launch My first blog Simple Complex
  74. 74. Most sites aren’t big.
  75. 75. http://www.flickr.com/photos/b-tal/163450213/ What do we do?
  76. 76. Concurrency sucks.
  77. 77. All roads lead to multi-core. http://www.flickr.com/photos/marc_buehler/3053243413
  78. 78. I’m scared. http://www.flickr.com/photos/amatuer_44060/2831112854/
  79. 79. Nehalem
  80. 80. UltraSPARC T2
  81. 81. 128 hardware threads
  82. 82. http://www.flickr.com/photos/daninrgb/3406117892 Ted thinks we’re screwed
  83. 83. StartServers
128
  84. 84. I don’t think so.
  85. 85. Lots of exciting work in concurrency today:
  86. 86. Actors STM Persistent data structures Dataflow Tuple spaces
  87. 87. Ted Leung, A survey of concurrency constructs http://tinyurl.com/mmbqe6
  88. 88. Scala Erlang Clojure Haskell
  89. 89. Python?
  90. 90. Unladen Swallow?
  91. 91. No more GIL!
  92. 92. No more GIL?
  93. 93. Better threads. http://www.flickr.com/photos/splityarn/3469596708/
  94. 94. Threading sucks. http://www.flickr.com/photos/sillydog/9844703/
  95. 95. I want actors! (Or STM, or whatever.)
  96. 96. Help! http://www.flickr.com/photos/zaia/3475695085
  97. 97. 2020
  98. 98. I want to be using Python!
  99. 99. Let’s make Python kick ass in 2020.
  100. 100. “ Good software takes ten years. Get used to it. — Joel Spolsky ” http://tinyurl.com/ca4pr
  101. 101. So we need to start now.
  102. 102. 1. Better inter-op.
  103. 103. WSGI 2
  104. 104. Django needs to do better.
  105. 105. We need leaders. http://www.flickr.com/photos/salimfadhley/26306549
  106. 106. http://www.flickr.com/photos/psd/3649586425/ A BDFL?
  107. 107. 2. Get in front of HTML 5.
  108. 108. 3. Rethink web development, again.
  109. 109. Pages
  110. 110. Applications
  111. 111. Sites
  112. 112. Full deployment stack, highly integrated, centered around WSGI 2?
  113. 113. Yes, please!
  114. 114. 4. Scale from day 1.
  115. 115. Be skeptical. http://www.flickr.com/photos/colorblindpicaso/2747637336
  116. 116. Plan to be replaced. http://www.flickr.com/photos/taurusaficionado/2099239684
  117. 117. Holy crap please give me better concurrency!
  118. 118. Thank you! Me: Jacob Kaplan-Moss This talk: http://jacobian.org/TO Email: jacob@jacobian.org Twitter: @jacobian
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×