Python syntax in Lisp and Scheme

Erann Gat my-first-name.my-last-name at jpl.nasa.gov
Thu Oct 9 15:47:48 EDT 2003


In article <yShhb.255119$R32.8279501 at news2.tin.it>, Alex Martelli
<aleax at aleax.it> wrote:

>  then you're really 
> designing your own private divergent language (which most posters from
> the Lisp camp appear to assert is an unalloyed good, although admittedly
> far from all).

FWIW, IMO "designing your own private divergent language" is not an
unalloyed good, but having the *ability* to design your own private
divergent language quickly and easily is.  Also, the "private divergent
languages" that most people design using Lisp macros are supersets of
Lisp, so that limits the extent to which divergence happens in practice.

Your position against macros and in favor of HOFs strikes me as being very
similar to those who want to ban model rocketry on the grounds that it is
too dangerous.  Yes, macros (and model rockets) can be dangerous.  If
you're not careful you can put your eye out with them.  But if you are
careful you can do very cool things with them and -- almost as important
-- learn a lot in the process.  (And what you learn from Lisp and model
rocketry are deep truths about the world, not a bunch of random kabuki
juju like what you fill your brain with when you learn C++.)  This
mindset, that anything that is potentially dangerous ought to be avoided
because it is potentially dangerous, is IMHO a perverse impediment to
progress.  There is no reward without risk.

Life is short.  It's not hard to produce a reasonable estimate of the
total number of keystrokes that you will be able to execute in a lifetime,
and it's a pretty small number in the grand and glorious scheme of
things.  If you have no ambitions beyond writing
yet-another-standard-web-app then macros are not for you.  But if your
goals run grander than that then the extra leverage that you get from
things like macros becomes very precious indeed.  Once your ambitions pass
a certain point the only option open to you is to teach your computer to
write code for you, because you don't have time to do it yourself.  For
example, there is no reason it should take multiple work years to write an
operating system.  There is no fundamental reason why one could not build
a computational infrastructure that would allow a single person to write
an operating system from scratch in a matter of days, maybe even hours or
minutes.  But such a system is going to have to have a fairly deep
understanding of the relationship of code to hardware.  You may want to
write things like:

(define-hardware-type ethernet-controller ...)

or

(define-hardware-standards-hierarchy
  (networking
    (ethernet
       (standard-ethernet
         (NE2000 ....))
       (fast-ethernet ...)
       (gigabit-ethernet ...))
    (fddi ...)
    (fibre-channel ...)
    ...)
  (mass-storage
    (hard-drive
      (ide ...)
      (scsi ...))

or

(is-a ne2000 standard-ethernet-card)

or

(define-register-layout ...)

God only knows.  Only one thing is certain: with macros and readtables you
will be limited only by your imagination.  With anything less you will be
limited by something else.

E.




More information about the Python-list mailing list