What's better about Ruby than Python?

David Abrahams dave at boost-consulting.com
Thu Aug 21 23:25:48 CEST 2003


Alex Martelli <aleaxit at yahoo.com> writes:

> I have nothing against macros *IN GENERAL*.  I just don't want them *in
> my general-purpose language of choice for the purpose of application
> programming*: they add NOWHERE NEAR ENOUGH PRODUCTIVITY, in application
> programming, to even START making up for the risks of "divergence" of
> dialects between individuals, groups, and firms.  If I was focused on
> some other field than application programming, such as experimental
> explorations, tinkering, framework-writing, etc, I might well feel quite
> otherwise.  But application programming is where the big, gaping hole
> of demand in this world is -- it's the need Python is most perfectly
> suited to fulfil -- and I think it's the strength it should keep focus
> and iinvestments on.

The question is, do application programmers need the components that
these framework-writers can painstakingly build out of macros?  No
application programmer needs to (knowingly) use macros, but if macros
allow framework-writers to provide application programmers with
abstractions which express their problems declaratively, in terms very
close to their mental model of the domain, it could be a huge
productivity win.

In the C++ world it is we framework writers who use metaprogramming to
provide application programmers with clean, concise, beautiful
interfaces that express just what they want, and work correctly (see
Boost.Python).  Users of our frameworks never need to (knowingly)
touch these fancy tools.

That said, Python's dynamic nature (there is no imperative to get work
done at compile time) makes it a lot harder to see where macros would
be a big win.  Even lisp can be meaningfully compiled, but Python
cannot (at least, not in the same sense of the word, not yet).  If
someone is asking for Python macros I'd like to see some example
applications.  Apologies if I missed them somewhere - it's a long
thread.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the Python-list mailing list