Live data from Hacker News

Mongrel2 Says, "Goodbye Python"

sheddingbikes.com

211–220 of 251 posts

Re: Mongrel2 Says, "Goodbye Python"

#211

Earlier quoted context omitted.

I am complete newbie when it comes to running a server but have a bit of experience using Ubuntu in my local box. Is ubuntu a good choice? Since most use a flavor of Red Hat like CentOS I am a bit hesitant to use Ubuntu in production.

It depends on what you are using the server for and who is using the server. Ubuntu and debian are used by plenty of people in production and are probably the better choice for learning how to set up a server if you already use ubuntu. Apt is also a great package manager.

Apt and yum are not very different. In the early 2000s, before yum Debian was a clear choice for packaging alone, but things have changed these days.

(I'm an Arch guy these days, but hey...)

Re: Mongrel2 Says, "Goodbye Python"

#212

Earlier quoted context omitted.

Oh yeah, that's no trouble at all.

Oh well, you know, it's definitely not trouble enough to drive me away from Python. Despite the whole version madness across Linux distributions, Python is still my preferred language for web development, and even if that means going through a bit of trouble getting it properly installed on a particular system, hopefully that is something I'll only have to do and document once every few years. I surely hope all distr…

It's trouble enough to drive people away from Mongrel2. Also, I find it weird that you take me saying "we ditched python in mongrel2 because of Linux" to mean "Python SUCKS! Stop using it." Never said the latter, only the former.

Re: Mongrel2 Says, "Goodbye Python"

#213
post #204
post #199

Earlier quoted context omitted.

Not to nitpick here, but I want to clarify something you said. > Per above, Python is used by your OS. It's installed by default, and not uninstallable, because the OS needs it. The OS doesn't need python. It is some package you have installed that needs python, like Gnome(py-gtk2) or KDE(py-qt), for your desktop environment or some application you decided you needed. If you don't understand what program on your serv…

> The OS doesn't need python. It is some package you have installed that needs python No. The installer and packaging system need Python. Anaconda and Yum depend on it. Try removing it and see. You cannot install a minimal RHEL or Fedora system without Python. I am fairly sure this applies to other distros too.

Whats to stop you from patching and compiling programs yourself to get rid of the python dependancies of your package manager?

If the Linux distro you choose doesn't meet your needs, why would you continue to use it? If your Fedora install requires it to be one way, but that doesn't fit the need of the server, it would like one should reconsider why they are using that distro.

Re: Mongrel2 Says, "Goodbye Python"

#214
post #206

Earlier quoted context omitted.

My count is 4636 lines, and I can imagine much. much smaller Python 2.3 code: ast.c 115 ast.h 45 cli.c 482 cli.h 31 cli.rl 143 commands.c 498 commands.h 5 config_file.c 193 config_file.h 27 constants.c 82 constants.h 14 lexer.c 360 lexer.rl 121 linenoise.c 433 linenoise.h 40 m2sh.c 27 mimetypes.csql 851 parser.c 1074 parser.h 15 parser.y 69 token.c 11

No, most of that is generated from the .rl files or just SQL that's common to everything. Also, you'll want to throw in all of Storm and PyREPL if you want a real comparison. Then again, 4600 lines of anything is tiny. You have a massively skewed view of "Big" and haven't disproven anything by finding 600 lines of cruft in one directory.

I fully agree with you that this is more than tiny for a C project, but it can be big compared to a small script. I also develop/maintain the projects measured in zipped megabytes (where I don't even have a wish to try to wait to count the lines!) I only compared it to some script solution.

You're right, 600 lines more or less are irrelevant. I just thought you're measuring something else as I saw the total of 1000 instead of 4000. Still it is all tiny for a real C program.

I also think that the C solution is more portable than the dependence on any version of Python. I also cross-compiled the code for 32 MB RAM mipsel platforms and I agree that only C dependencies are better than any script language dependencies (not counting shell, when it's carefully written).

But I actively use both Perl and Python so I'd still really like to know what was lacking in Python 2.2 or 2.3 or 2.4, of course only in case you already knew that you were to have any Python on the target computer. But then if you couldn't expect to have any Python, then the fact that distros still use older versions wasn't of much relevance.

Re: Mongrel2 Says, "Goodbye Python"

#215
post #213
post #204

Earlier quoted context omitted.

> The OS doesn't need python. It is some package you have installed that needs python No. The installer and packaging system need Python. Anaconda and Yum depend on it. Try removing it and see. You cannot install a minimal RHEL or Fedora system without Python. I am fairly sure this applies to other distros too.

Whats to stop you from patching and compiling programs yourself to get rid of the python dependancies of your package manager? If the Linux distro you choose doesn't meet your needs, why would you continue to use it? If your Fedora install requires it to be one way, but that doesn't fit the need of the server, it would like one should reconsider why they are using that distro.

If you're just running Linux on your PC in your dorm room, go for it.

If you're running 10,000 machines you don't make changes that you haven't regression tested and aren't committed to supporting. Effectively, you'd need to write your own package manager, maintain your own repository and deal with upstream yourself... You'd be Red Hat.

Re: Mongrel2 Says, "Goodbye Python"

#216

Earlier quoted context omitted.

So after complaining that he could not use new language features that appeared six years ago, he went back and rewrote the whole thing using a different language whose syntax is much much more than six years ago. I guess he must have found these must-have Python 2.5 language features that are so important and desirable in C. And by the way, don't use new GCC features, because some ancient GCC versions will be support…

It was users complaining, not me. I had no problem with Python, but all of the non-python users (the users of one of the 9 other languages Mongrel2 supports) hated Python for these reasons.

Did you by any chance have the users who haven't had any Python installed?

Re: Mongrel2 Says, "Goodbye Python"

#217
post #45

Earlier quoted context omitted.

> 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…

generators

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"

#219
post #86

Earlier quoted context omitted.

If there is one thing that ticks me off about modern unix it is that to install I end up having to install / upgrade half the rest of the system because of all the interdependencies between packages.

Tell me about it! I just wanted to install folding-mode for Emacs the other day, dselect wanted to install a new sodding IM client as well! (Something in emacs-goodies-el depended on it). About 50M it came to! So I just did it by hand, more like 50k...

That is a pretty wild example, but it is common in software today.

Microsoft does stuff like this all the time, deprecating good .NET libraries for stupid ones just because of God knows what reasons (none of them intelligible to non-political folk).

Re: Mongrel2 Says, "Goodbye Python"

#220
post #94

FYI - Fedora 13 shipped with Python 2.6, Fedora 14 is going to ship with Python 2.7 and 3.1 in parallel. Not every distribution ships ancient versions. I also recommend using virtualenv and pip, these tools make it much easier to create an easily reproducable Python environment.

Not every distribution ships ancient versions. RHEL, meanwhile, does not ship 3.1, 2.7 or 2.6. And to be perfectly honest, if you're seriously distributing Python software you have to take RHEL into account -- "Fedora ships something newer" doesn't help.

I don't use Python at all. Despite that, I still somehow have Python 2.6.4 installed on my RHEL4 box at work. (Incidentally, the Linux version number is only slightly higher -- 2.6.9!!!)

So it seems like it's possible to get 2.6 on RHEL. I did it, and I hate Python.

Post reply on HN