"sins" (aka, acknowledged language problems)

neelk at cswcasa.com neelk at cswcasa.com
Mon Dec 27 16:13:33 EST 1999


François Pinard [mailto:pinard at iro.umontreal.ca] wrote:
>neelk at brick.cswv.com (Neel Krishnaswami) writes:
>
>> As a general rule, syntax is a bad thing, to be avoided whenever
>> possible.  Calls for additional syntax are typically a sign that
>> one of the basic operations of the semantics needs generalization.
>
>I might not go that far.  Features come through syntax or 
>libraries: Perl or LISP, to name some extremes.  A good thing 
>which often comes with syntax is that, when used intelligently, 
>it forces some redundancy in the language which a compiler can 
>later check.  Programmers might grumble and moan somewhat, but 
>they win in the long run.  When everything generalizes, the 
>compiler stops being our friend, at some point.

I was specifically thinking of Lisp, as a matter of fact. Its
extremely minimalistic syntax permits the creation of a macro 
system that allows real syntactic abstraction. (Call it 
transformational programming if the word "macro" gives you
flashbacks to C preprocessor hacks. :])

An example: I am currently playing with Screamer, which is
a package that seamlessly adds Prolog-style nondeterminism and 
constraint programming to Common Lisp. It's fast, too,
because the package is able to compile the expressions you
write into CPS form and optimize them. More, once installed
the extension is every bit a part of the language as (say) CLOS
is. 

Doing a similar thing for Python would not be a task for the 
faint of heart. 

--
Neel Krishnaswami
neelk at alum.mit.edu




More information about the Python-list mailing list