greg <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: >> compilers are GREATLY facilitated by having a >> macro facility because (at first blush) all you need to do is to >> macro-expand down to something you know how to turn into code. > > There's no way you could compile Python to efficient > machine code just by macro expansion. You'd also need > some very heavy-duty type inferencing.
When I used to use Ruby a lot, I believed this line that the Ruby community fed itself (and apparently Python feeds itself as well): Ruby/Python has to be interpreted because it's too dynamic. This is wrong, of course. A compiler shifts a lot of decisions that an interpreter would have to make at runtime to compile-time. There is no reason a dynamic language can't enjoy this efficiency. On the other hand, if Python is doing a hash lookup on every function call, as Alex Mizrahi claims, compilation may not do much to smooth over such awkwardness. > Python is extremely dynamic, even more so than Lisp. > That's why compiling Python is hard, not because it > doesn't have macros. Uh huh. "More so than Lisp"? Just making stuff up now? Despite its dynamism, Lisp is quite compilable. For example, I can redefine classes, functions, macros, etc. at runtime and compiled code referring to the old code will still work. You are conflating dynamism with interpretedness, and that's incorrect. -- http://mail.python.org/mailman/listinfo/python-list