The reality of Stefan Scholl

"I hope there's pudding"

Benchmarks are merciless

A number 1/4 for A vs. B means that B is 4 times slower than A.

The Computer Language Benchmarks Game is more a community benchmark than a programming language benchmark. You get some ballpark figures that confirm what you already know beforehand: C++ is faster than Ruby :-)

But it's still depressing to see that a current implementation of JavaScript is faster than Python. Comments

Plone is like Emacs

Not about beer

No, this has nothing to do with the Emacs is like beer article. The article was about Emacs users and this is more about the critics of Emacs and Plone.


People (mostly vi users) laughed at Emacs, because it was a big, fat editor. "Eight Megabytes And Constantly Swapping" was the meaning of the name back then.

Today Vim isn't much smaller anymore and we hardly remember the time when 8 MiB of RAM were a lot of memory. Emacs looks relatively small when compared to big IDEs, written in Java.


That's similar to Plone.

Plone is an Open Source CMS written in Python. And it has the reputation of being fat and slow. A resource hog that needs a big server just to show a few pages in bearable time.

The speed got better from release to release and is still an important point in the development. But what's more important: Today's servers have more than just 256 MiB RAM, as recommended for a straightforward Plone site.

The server setup of

You can get a similar system for about 60€/month from respected hosting companies.

We programmers are always looking for technology that scales and can handle many concurrent users. That's the reason for the rise of Erlang web frameworks and the downfall of Ruby on Rails. But most of the time our projects won't get as many hits in a year as gets in a day. A medium sized server can handle more than one medium sized Plone site for you.

So, Plone is like Emacs. Once laughed at because of the size. But computers became bigger and faster, making this a non issue. What stays is the question of the complexity. To quote Wikipedia: Plone's weaknesses include Python and Zope experience requirements for those wishing to add or extend the feature set, making for a considerable learning curve for developers.

Tags: Plone, Python, Emacs

Hey, let's deploy this Python Web Application!

Please choose:

  1. Apache + mod_python
  2. WSGI
  3. CGI
  4. FastCGI
  5. Python webserver
  6. Python webserver behind Proxy
  7. SCGI
  8. just give up
Background: A customer's hosting service has a nice table with all features that are available. Packet A and B don't allow Python and Ruby. But packet C does. Nice!


They don't tell you which version of Python or how to use/deploy it. Comments

Fan of Harry Potter and Python?

$ sudo ln -s `which python` /usr/local/bin/parseltongue


Batteries included

The imports of a current project at work:

$ grep -h import *.py|sort -u
from __future__ import with_statement
from cStringIO import StringIO
from ftplib import FTP
from xml.etree import ElementTree
import ConfigParser
import csv
import glob
import logging, logging.handlers
import os
import sys
import time
import traceback
import zipfile

Small program (500 lines, w/o empty lines and comments), but a lot of things get done.

You don't have to download and install a single additional library for this. Everything is included in the standard distribution of Python 2.5. "Batteries Included", they call it. And it fits.

I know, this isn't unique to Python. But it's seldom enough in the programming language world to be mentioned. And it's not only quantity. The libraries are very usable and have most of the features you need. It was possible to generate some data from multiple XML files and send it in a ZIP archive to a ftp server - all without generating any real files in the local filesystem.

Tags: Praise, Python

Migrating Python 2.4 to 2.5 isn't always fun

$ python
Python 2.4.4 (#2, Apr 5 2007, 20:11:18)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import StringIO
>>> x = StringIO.StringIO(u"m\xf6p")
>>> import cStringIO
>>> x = cStringIO.StringIO(u"m\xf6p")
$ python2.5
Python 2.5 (release25-maint, Dec 9 2006, 14:35:53)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-20)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import StringIO
>>> x = StringIO.StringIO(u"m\xf6p")
>>> import cStringIO
>>> x = cStringIO.StringIO(u"m\xf6p")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 1: ordinal not in range(128)

The Problem: cStringIO is used by xml.sax's parseString()

Tags: Python

Programming Language Harmony

You can find some snippets to make Python work with Haskell on PythonVsHaskell.

The code is for Windows, but it shouldn't be difficult to adapt this to Unix.

Finding this on a X vs Y page gives you some hope in humanity again. :-)

In the real world it isn't about which one is the ultimate programming language. When you think beyond this, you can choose more freely and combine the best of all the available tools for the job.

OCaml and Ruby can live together, too.

Even Common Lisp and Java can be used in one project without causing a rift in reality: CLiki page about Java


Some crazy guy announced a Python implementation in Common Lisp!

Willem Broekema announced CLPython in his news posting <> today.

That's really crazy shit! (Meant in a good way! :-)

A Python implementation in Common Lisp. At the moment it's Allegro only, but in the future we could perhaps compile CLPython with Python to run Python ... (CMUCL's compiler is called Python, too. :-)

Sound's like fun.

By the way: There's a similar approach called Python-on-lisp. This project uses the real Python and builds a bridge to it.

Tags: Lisp, Python