Python syntax in Lisp and Scheme

Andrew Dalke adalke at mindspring.com
Thu Oct 9 14:29:41 EDT 2003


Pascal Costanza:
> So what's the result of ("one" - "two") then? ;)

It's undefined on strings -- a type error.  Having + doesn't
mean that - must exist.

(A more interesting question would be to ask what
the result of  "throne" - "one" is.  But again, a type error.)

Pascal Costanza:
> It's a myth that bytes are restricted to 8 bits. See
> http://www.wikipedia.org/wiki/Byte

(I can't connect to the URL but I know what you're talking
about.)

Sure.  But I'm just barely old enough to have programmed on
a CDC Cyber.  When I see the word 'byte' I assume it means
8 bits unless told otherwise.  When I buy memory, I don't ask
the sales staff "so is this an 8 bit byte or a 60 bit byte?"  (And
yes, I know about the lawsuit against disk drive manufacturors
and their strange definition of "gigabyte", but even then, they
still use an 8 bit byte.)

Me:
> > Is there consensus on the Unicode API?

Pascal Costanza:
> No, not yet. ANSI CL was finalized in 1994.

Sure.  That's why I asked about consensus.  De facto rather
than de jure.  SAX for XML processing is a de facto standard
but portable across different implementations and even
portable across different languages (that is, there's a very
mechanical and obvious way to convert from one language
to another.)

> Again, not part of ANSI CL. Don't judge a standardized language with the
> measures of a single-vendor language - that's a different subject.

I understand your point of view.  OTOH, it's like when I used to
work with C.  It was standardized, but required that I download
a slew of packages in order to do things.  Eg, I had to evalutate
several different regexp packages before I found one which was
appropriate.  I know there are good reasons for a standard to
leave out useful packages, but I know there are good reasons for
an implementation to include a large number of useful packages.

Is there a free Lisp/Scheme implementation I can experiment with
which include in the distribution (without downloading extra
packages; a "moby" distribution in xemacs speak):
 - unicode
 - xml processing (to some structure which I can use XPath on)
 - HTTP-1.1 (client and server)
 - URI processing, including support for opening and reading from
        http:, file:, and https:
 - regular expressions on both 8-bit bytes and unicode
 - XML-RPC
 - calling "external" applications (like system and popen do for C)
 - POP3 and mailbox processing

As far as I can tell, there isn't.  I'll need to mix and match packages
from a variety of sources.  It isn't like these are highly unusual
requirements; I use them pretty frequently in Python.  For examples:

 - connect to my POP server, delete messages with .exe attachements
     on the assumption that it's spam
 - Use DAS (see http://www.biodas.org/) to get genomic sequence
      annotations.  Requires HTTP and XML processing (mostly
      Latin-1 encoding)
 - Make an XML-RPC server which takes as input molecular
     structure information (eg, "CCO" is ethanol) and calls several
     existing command-line packages to compute properties about
     the compound.  Parse the output with regular expressions and
    combine and return all the results.
 - Make a client which uses that server.

(Okay, looks like https isn't needed for these, but the rest are.)

> (Apart from that, Jython also doesn't provide everything that Python
> provides, right?)

No, but there is a good overlap.  I believe all of the above are
supported on both implementations.

> Pick the one Common Lisp implementation that provides the stuff you
> need. If no Common Lisp implementation provides all the stuff you need,
> write your own libraries or pick a different language. It's as simple as
> that.

Which Common Lisp *distribution* provides the above?  I
don't doubt that an implementation + some add-in packages do
all that, but each new package means one extra lump on the
barrier to entry and one extra worry when I want others to
use the code I've written.

I use Python in part because of the "batteries included"
philosophy.  There will always be 3rd party packages (PIL for
images, ReportLab for PDF generation, PyDaylight or OEChem
for chemical informatics), but there's a lot which comes in
the standard distributions.

> You can ask these things in comp.lang.lisp or in one of the various
> mailing lists. Common Lispniks are generally very helpful.

Understood.  I did managed to get the biolisp code working, btw.

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list