Python has these useful features and has had them for years; why is it acceptable to say that it will be 5-10 years before we can reliably use anything new?
Python has these useful features and has had them for years; why is it acceptable to say that it will be 5-10 years before we can reliably use anything new?
Did you understand that he wrote the big C program just to process a small file with the syntax as in the following example (taken from his own file):
main = Server(
chroot="./",
hosts = [mongrel2]
)
settings = {"zeromq.threads": 1}
mimetypes = {".txt": "text/plain"}
servers = [main]Distributing a framework like Django, on the other hand, when distros lag six years behind current Python, is a royal pain in the ass.
Meanwhile, anyone who depends on Python for much more than a config-file parser knows what a genuine and large issue this is, and that "just write to the lowest common denominator" is not really a reasonable solution.
And I still don't know if he tried adjusting his already existing Python code to simply be backwards compatible -- he never mentions that, neither why that would be a problem in his particular case.
Regarding Django, see the other replies here about side-by-side installations, it's more than reasonable if you have something big which always runs, but not reasonable for a small config script used once.
$ rm src/parser.c src/cli.c src/lexer.c src/linenoise.c
$ wc -l src/*.c src/*.rl 148 src/ast.c
646 src/commands.c
267 src/config_file.c
93 src/constants.c
36 src/m2sh.c
13 src/token.c
186 src/cli.rl
156 src/lexer.rl
1545 total
That's dinky tiny, even with the linenoise and generated files it's only 4061 lines long, which isn't much at all. 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 11Then 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.
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.