Python dos2unix one liner

Albert van der Horst albert at
Fri Mar 12 15:13:55 CET 2010

In article <hmdlc0$ocq$1 at>,
Martin P. Hellwig <martin.hellwig at> wrote:
>On 02/28/10 11:05, Stefan Behnel wrote:
>> Steven D'Aprano, 28.02.2010 09:48:
>>> There ought to be some kind of competition for the least efficient
>>> solution to programming problems
>> That wouldn't be very interesting. You could just write a code generator
>> that spits out tons of garbage code including a line that solves the
>> problem, and then let it execute the code afterwards. That beast would
>> always win.
>> Stefan
>Well that would be an obvious rule that garbage code that does not
>contribute to the end result (ie can be taken out without affecting the
>end result) would not be allowed. Enforcing the rule is another beast
>though, but I would leave that to the competition.

Thinking of the international obfuscated c contest (iocc).
It is easy to make a mess of a program using the preprocessor.
It is also easy to preprocess then prettyprint the program.
If the result is not obfuscated, it impresses nobody.
Likewise the judges would think nothing of a program with garbage,
and would rate it low, so such rule is unnecessary.

>Though the idea of a code generator is solid, but instead of generating
>garbage, produces a virtual machine that implements a generator that
>produces a virtual machine, etc. etc.

That was actually done by Lennart Benschop. He made a Forth program
run by an interpreter written in C.
Although Forthers thought it was straightforward comprehensible
code, it was a winner in the iocc.


Groetjes Albert

Economic growth -- being exponential -- ultimately falters.
albert at spe&ar& &=n

More information about the Python-list mailing list