Why is Python popular, while Lisp and Scheme aren't?

Kenny Tilton ktilton at nyc.rr.com
Thu Nov 21 02:47:17 EST 2002


Dennis Lee Bieber wrote:

> Alexander Schmolck fed this fish to the penguins on Wednesday 20 
> November 2002 04:40 pm:
> 
> 
>>macros would make it feasible to write extremely readable code (even
>>
> 
>         Forgive my intrusion but...
> 
>         Macros have always seemed to me to be a means of implementing 
> work-arounds for what a language lacks in its native definition. 


Not a workaround, but a way to embed a domain-specific language within 
Lisp. Or just to hide a lot of plumbing that would otherwise clutter up 
the code. But, hey, there is at least one CL venerable who does not 
think macros are necessary.


> Granted, the only languages I've been exposed to with macros are the C 
> family,...


That one I know, and it just substitutes tokens. In CL a macro is CL 
code which than rewrite its input (the "body" argument) to generate new 
code actually seen by the compiler.


>         Macros in LISP may make it possible to write "extremely readable code" 
> -- but what level of LISP expertise is required to write those macros?



Not much. It's just that you are writing code which takes apart the 
client code and reassembles it to suit some package, saving the client 
all that trouble. (That sounds like a function, hence the opposition to 
macros by the fellow i mentioned before.) I can macroexpand code to 
check what form the compiler will see, but when I screw up I usually 
find out at compile or runtime.


> 
>         If you have to supply the macros ahead of time, the users aren't 
> learning LISP, they are learning "MacroExtendedLISP"...


Yes, macros could be abused that way. but key is to produce a 
/different/ domain-specific language, say a 3d-animation "language" 
which swims with the host code.



kenny
clinisys




More information about the Python-list mailing list