Ian Bicking: the old part of his blog

Re: The Challenge Of Metaprogramming

If you think Lisp macros are hard you should try writing a system for load-time code-generation in Python, Perl or Ruby. It's not that you can't do it. You certainly can. It's that the result is a horrific mess.

Comment on The Challenge Of Metaprogramming
by Aminorex

Comments:

"You certainly can. It's that the result is a horrific mess."

What sort of things are you thinking of?

# phil jones

In Python you shouldn't be doing code generation. You can generally accomplish the same things in other ways in Python. Of course, in some cases people do code generation, most commonly templating languages, but I don't know that Lisp macros really apply there either. But otherwise code generation is used in a limited way, without actually losing the power of code generation.

That isn't to say that macros aren't useful, and that syntactic extensions aren't something that Python programmers could make use of, but that's a somewhat separate issue from code generation as a technique for implementing syntactic extensions.

# Ian Bicking