News for hackers. Stuff that matters.
Re:Mongrel2 Says, "Goodbye Python" by donaq on Tuesday September 21, 2010 @07:23AM (#1712168)
It's sad and ironic (for Python) that Zed actually had to switch from Python to C to make Mongrel more portable.

Disclaimer: I love Python, but I hate that anything but the most trivial code won't run across all versions.

Re:Mongrel2 Says, "Goodbye Python" by rbanffy on Tuesday September 21, 2010 @07:36AM (#1712190)
> I hate that anything but the most trivial code won't run across all versions.

Please, define "all versions" and "most trivial code".

I have very little problems with Pythons ranging from the ancient 2.4 to modern 2.7. Of course, I am careful with what I do. I know if I use a dictionary comprehension I will be limited to 2.7+, so I try not to. I am quite sure a lot of the code I write could run under any 2.x Python with little modification. As for 1.x, I will agree that things get more complicated.

Re:Mongrel2 Says, "Goodbye Python" by donaq on Tuesday September 21, 2010 @12:05PM (#1713084)
Well, it's a matter of opinion, but I would define "all versions" as versions sharing a major number, i.e. code targeting 2.2 should run on anything starting with 2. As for trivial code, just look at the string operations part of the documentation and search for "new in" and "changed in". My connection is rather slow right now, to the point that the page I mentioned is still loading, so I won't look for more examples, but string processing should IMO be trivial parts of any language. Don't get me wrong, the changes have mostly been useful ones for 2.x versions, but I have been caught testing scripts on my own box that end up not working after deploying. Since then, I have been, as you say, more careful, but I feel I have a valid gripe when I expect string and io operations to be consistent across major versions without having to do a fine print and version check. :)
Re:Mongrel2 Says, "Goodbye Python" by zedshaw on Tuesday September 21, 2010 @02:00PM (#1713469)
generators
Re:Mongrel2 Says, "Goodbye Python" by rbanffy on Tuesday September 21, 2010 @05:40PM (#1714201)
I know that if I really need generators, then I really need to install something newer than the 2.4 that comes with RHEL/CentOS 4.

Generators is 2.6+, right?

BTW, an ugly approach I used (more or less as a joke) was to check for generator availability and, in case I can't use them, use a list comprehension instead. There is a performance/memory hit but, depending on what you are doing, it's a usable alternative. And a nice place to hang humorous comments.

But I agree that, if your users don't want to install an alien (from the package manager POV) Python in order to run Mongrel, getting rid of python code is the right thing to do.

It's like having a weird dependency, kind of requiring a Fortran 77 compiler in order to run Perl...

Re:Mongrel2 Says, "Goodbye Python" by pdonis on Tuesday September 21, 2010 @10:36PM (#1714990)
Um...generators are Python 2.2+ (introduction of the yield statement):

http://docs.python.org/release/2.2/ref/yield.html

Generator expressions are 2.4+:

http://docs.python.org/release/2.4/ref/genexpr.html

That said, I don't disagree with removing the Python dependency from the "core" of Mongrel2. As was noted in an earlier comment, people can always write a config file management tool in any language they want (or Mongrel2 bindings in general, for that matter).

Re:Mongrel2 Says, "Goodbye Python" by rbanffy on Wednesday September 22, 2010 @08:51AM (#1715928)
> Generator expressions are 2.4+:

So, what is the big deal? I can swear the oldest Python I had to deal with for the last couple years was 2.4.