Python syntax in Lisp and Scheme

Doug Tolton doug at nospam.com
Thu Oct 9 14:20:22 EDT 2003


Alex Martelli wrote:

> Doug Tolton wrote:
>    ...
> 
>>don't know me or my background.  Alex has stated on many occasions that
>>he has not worked with Macros, but that he is relying on second hand
>>information.
> 
> 
> I never used Common Lisp in production: in the period of my life when I
> was hired (by Texas Instruments) specifically for my knowledge of "Lisp",
> that meant Scheme and a host of other dialects (mostly but not entirely now
> forgotten).  I did use things that "passed for" macros in those dialects:
> I had no choice, since each TI lab or faction within the lab was using a
> different divergent mutant thing, all named "lisp" (save a few were named
> "scheme" -- hmmm, I do believe that some were using Prolog, too, but I
> did not happen to use it in TI), with some of the divergence hinging on
> locally developed sets of macros (and some on different vendors/versions).
> 
> For all I know, CLisp's macros are SO head and shoulders above any of a
> quarter century ago that any vaguely remembered technical problem from 
> back then may be of purely historical interest.  I do believe that the
> divergence problem has more to do with human nature and sociology, and 
> that putting in a language features that encourage groups and subgroups 
> of users to diverge that language cannot be compensated by technical
> enhancements -- it _will_, in my opinion, cause co-workers in any middle- 
> or large-sized organization to risk ending up standing on each others' 
> feet, rather than on each others' shoulders. (Remedies must of course 
> be sociological and lato sensu political first and foremost, but the way
> the language & tools are designed CAN help or hinder).
I can understand and respect honest differences of opinions.  I too 
believe that causes of divergence are largely sociological.  I differ 
though in thinking that features which allow divergence will necessarily 
result in divergence.

I have this personal theory (used in the non-strict sense here) that 
given enough time any homogenous group will split into at least two 
competing factions.  This "theory" of mine had it's roots in a nice 
dinner at Medieval Times in California.  We had arrived for dinner and 
we were waiting to be seated, everyone was milling around in a sort of 
shop/museum area.  We had been given "crowns" for dinner, but no one 
paid much attention to them.  We were one large group of people, bound 
by nothing and separated by nothing.  Then the one of the staff took a 
microphone and began giving us instructions.  She told us the color of 
our hats indicated the color of the Knight we would be rooting for, and 
tha we would be sitting only with people of similar colored crowns. 
Immediately the group (without instructions from the hostess) began 
separating into similarly colored groups.  Then they began calling the 
groups by color to be seated.  When they called out group, and we were 
ascending the staircase, I looked over my shoulder at the remaining 
groups.  I was utterly shocked to see apparent hatred and revulsion of 
our group on people's faces.  To me this was a game, but to some people 
in the crowd, having a different colored crown was a serious cause for 
emnity.

I have long looked back on that incident, and I have since compared it 
to many situations I have observed.  Over time it seems to me that human 
beings are incapable of remaining as one single cohesive group, rather 
that they will always separate into several competing factions.  Or at 
the very least groups will splinter off the main group and form their 
own group.

So it doesn't surprise me when groups splinter and diverge if they are 
not strictly controlled from an organizational or sociological point of 
view.

However in the opensource world I expect splinters to happen frequently, 
simply because there is little to no organizational control.  Even 
Python hasn't been immune to this phenomenon with both Jython and 
Stackless emerging.

Some people want power and expressiveness.  Some people want control and 
uniformity.  Others still will sacrifice high level constucts for raw 
pedal to the metal speed, while others wouldn't dream of this sacrifice.

What I'm getting at is that I can understand why people don't like 
Macros.  As David Mertz said, some people are just wired in dramatically 
different ways.

> 
> So, I'm nowhere near an _expert_ -- over 20 years' hiatus ensures I
> just can't be.  But neither is it totally 2nd hand information, and if
> I gave the mistaken impression of never having used macros in a
> production setting I must have expressed myself badly.  I do know I
> jumped on the occasion of moving to IBM Research, and the fact that
> this would mean going back to APL instead of "lisp" (in the above
> vague sense) did matter somewhat in my glee, even though I still 
> primarily thought of myself as a hardware person then (the programming 
> was needed to try out algorithms, simulate possible hardware 
> implementations thereof, etc -- it was never an end in itself).
> 
Thank you for that clarification.  I must have been mis-interpreting 
something, because I did think you had never used them.
> 
> 
>>I don't claim to be a guru on Lisp, however I believe I understand it
>>far better than Alex does.  If the people who actually know and use
>>Common Lisp think I am mis-speaking and mis-representing Lisp, please
>>let me know and I will be quiet.
> 
> 
> Give that I've heard "everything and its opposite" (within two constant
> parameters only: S-expressions are an unalloyed good -- macros are good,
> some say unconditionally, others admit they can be prone to abuse) from
> posters on this thread from "people who actually know and use" Lisp, I
> don't know how you could "mis-speak and mis-represent" as long as you
> stick to the two tenets of party doctrine;-).
> 
For me it isn't about party doctrine. :-p  My mindset very closely 
matches Paul Grahams.  I can understand why other people have a 
different mindset, and from what you've said I can even understand why 
you don't like Macros, I just have a different viewpoint.

What get's me is when people (and I do this sometimes as well) expess an 
opinion as fact, and that all rational people will agree with them.  So, 
for what it' worth, for the times I have expressed my opinion as the one 
true way of thinking, I'm sorry.
> 
> 
>>Like I said, I'm not an expert at Lisp, but I think I understand the
>>spirit and semantics of Lisp far better than Alex, and from what I've
> 
> 
> If by Lisp you mean Common Lisp and exclude Scheme, I'm sure you do; if
> Scheme is to be included, then I'm not sure (but it's quite possible,
> nevertheless) -- at least the "spirit" of the small core and widespread
> HOFs w/single-namespace seem to be things I understand more (but the
> "spirit" of why it's so wonderful to have extensible syntax isn't:-).

Honestly I've only used scheme in trivial things.  My preference has 
been more towards Common Lisp, primarily because I need it for building 
real systems, rather than doing language research.

I'm sure there many things that you know that I don't.  From what I 
understand you've been at this a bit longer than I have.  I've only been 
  doing serious programming for a little over ten years now.  In that 
time I have been involved with some very large projects on a very large 
scale.  I think I understand the concepts of abstraction and code reuse 
pretty well, and how to build large systems that integrate the efforts 
of numerous people.

I personally just don't believe macros are "evil" per se.  I believe 
they like any other tool can be used effectively, or misused 
effectively.  However most of my problems don't come from people who 
misuse advanced features of the language, rather they come from people 
who don't understand basic concepts of optimization and code reuse.

In any event, I think Lisp and Python are both great languages.  I use 
Python every day at work, and I work on learning more about Lisp (and a 
top secret pet project ;) ) every day.  I very much respect your 
knowledge Alex, because I do believe you have some good insights, and I 
do enjoy discussing issues that we disagree on (when we aren't being 
"bristly" ;) ) because you have many times helped me to understand my 
own point of view better.  So even though we don't always agree, I still 
appreciate your opinions.

-- 
Doug Tolton
(format t "~a@~a~a.~a" "dtolton" "ya" "hoo" "com")





More information about the Python-list mailing list