News for hackers. Stuff that matters.
Re:Python is the new BASIC by protomyth on Friday July 31, 2015 @10:00AM (#9981780)
This is the one lesson of PHP that seems to be ignored by a lot (most?) new languages. If you want your language to be popular with beginning web programmers, then provide system administrators with a dead simple way to install it. Add package, done. Then make sure it doesn't cause too much trouble or at least upgrades easily.

If it takes almost no effort to install your language and any modules that users might need, then the system administrator will just add it to the list of things to install. PHP is everywhere because its very easy.

Re:Python is the new BASIC by tacone on Friday July 31, 2015 @10:15AM (#9981859)
Actually is not just about easiness, rather than safeness.

PHP historically did not come with a disposable webserver, and writing one was hard. All the focus was on stateless applications. So while the smart guys were dealing with the memory leaks of their wonderful engineered systems, PHP monkeys were able to get things done with almost no fear to bring down the server.

I remember reading that Aaron Swartz used to go to bed with his laptop in order to be able to quickly restore Reddit in the case it crashed during the night. [Citation needed]

For hosting companies of the time, the choice of the language was pretty obvious. Most of them have policies of automatically killing long-running processes even nowadays.

Re:Python is the new BASIC by mtberatwork on Friday July 31, 2015 @10:15AM (#9981855)
It's really only "easy" if you are using mod_php. If you are using PHP-FPM, FastCGI, etc, as most people do who run production PHP, then things get about as complicated as using uWSGI, mod_wsgi, etc with Python.

On that note though, getting mod_wsgi up and running with Apache is really quite simple.

Re:Python is the new BASIC by bite_victim on Friday July 31, 2015 @10:38AM (#9982019)
You are absolutely right, strictly speaking it is the same thing. Getting a simple 'Hello World!' from the server though is a different thing but it is by no fault of Apache, Python is just not PHP when it comes to web development in the sense that you need this:

  def wsgi_app(environ, start_response):
      output = 'Hello World!'
      status = '200 OK'
      headers = [('Content-type', 'text/plain'),
                ('Content-Length', str(len(output)))]
      start_response(status, headers)
      yield output

  # mod_wsgi need the *application* variable to serve our small app
  application = wsgi_app
Instead of this:

  <?php

  echo 'Hello World!';
Re:Python is the new BASIC by codygman on Friday July 31, 2015 @11:23AM (#9982314)
Using a framework built on top of wsgi such as flask you do get that though.
Re:Python is the new BASIC by marcosdumay on Friday July 31, 2015 @10:57AM (#9982136)
Getting mod_wsgi to run is really easy.

Adapting your wsgi script for "what? is it in a virtual env? Where? What version of Python is running on this server?" and other similar problems is not so easy.

But yes, it's a matter of an hour or two for a complete newby to complete it. It completely disappears when compared to the time it takes to develop the site, but lots and lots of people consider it the most important aspect of a platform, because it comes first.