What's better about Ruby than Python?

Alexander Schmolck a.schmolck at gmx.net
Tue Aug 19 18:32:44 EDT 2003


"Andrew Dalke" <adalke at mindspring.com> writes:

> Alexander Schmolck:
> > No it isn't. Like every other language I know python sucks in a variety of
> > ways (only on the whole, much less so), but I don't claim I know how to
> fix
> > this with a macro system.
> 
> What about the other way around?  Make a macro for Lisp or
> Scheme which converts Python into the language then evals
> the result?

Actually, at least one person has been working on this for scheme (I've never
heard about it again and he targeted about the most useless scheme
implementation around).

One thing that makes such an attempt fairly unattractive for anyone with
finite amounts of time is that python isn't that much use without its
supporting C/C++ modules schemes/lisps suck in the FFI department (every
lisp/scheme has its own way of interfacing to C).

> 
> Given how easy it is to parse Python (there are several Python
> parsers for Python) and the number of people who have popped
> up with Lisp background, I'm surprised no one has done that
> for fun.  After all, there is Python for C, Java, .Net, and for
> Python (PyPy) and variations like Pyrex and Vyper.  But
> none for Lisp?

Would certainly be interesting.

> 
> (I think I remember mention of one some years ago, .. I think
> *I* posted that link to c.l.py, but I don't remember when and
> can't find it via Google.)
> 
> > But show me how to write something like CL's series package that way (or
> > better yet, something similar for transforming array and matrix
> manipulations
> > from some reader-friendly representation into something efficient).
> 
> The Boost code for C++ suggests a different way to do the latter.
> (I don't think templates are the same as hygenic macros.)

Could you say a little bit more about it? In python I think one could to some
extent use operator overloading and a special expression class, that
simplifies the literal expression the programmer stated, but I guess then one
would then to explicitly request evaluation (and operator overloading isn't
quite powerful enough to easily incorporate 'alien' class-instances, too).

Is the C++ code something along those lines, or different?


'as




More information about the Python-list mailing list