[OPINION] - does language really matter if they all do the samething?

Aahz aahz at pythoncraft.com
Thu Feb 5 08:37:55 EST 2004


In article <mailman.775.1075073642.12720.python-list at python.org>,
Dietrich Epp  <dietrich at zdome.net> wrote:
>On Jan 25, 2004, at 7:14 AM, Aahz wrote:
>> 
>> Quite frankly, though, for this kind of application, I probably would
>> choose to write a domain-specific language (more precisely, a "smart"
>> config file format).  That would make it easier for someone who
>> wasn't a programmer to add functionality.  As I said earlier, I don't
>> think the fact that Lisp makes it easy to directly express this idiom
>> makes up for its other faults.

   [code deleted]

>...am I making this clearer?

Somewhat, though your code could certainly stand to be more Pythonicly
written -- which it's clear you already know, given that you've chosen
to re-implement the built-in ``apply()`` with its replacement.  As for
your hints, what didn't you understand about my comment above?

>You may choose to write a domain-specific language.  This was my 
>original idea as well.  The early versions of this program had the 
>tables in XML files, and the Python code was short and sweet.  However, 
>as I started writing some of the more complicated tables, I needed to 
>write hooks in the XML back into Python, and eventually one of the XML 
>files saw the presence of a few 'lambdas' here and there.  I changed 
>the XML files, I refactored the Python code, but XML didn't integrate 
>code well enough with its data, and Python didn't integrate data well 
>enough with its code.  The Lisp code that replaced everything is 
>smaller, faster, easier to read, and easier to write.

When I said "domain-specific language", I was thinking of something
similar to what Quixote does.

>My only point is that Python is not the right tool for every project.  

No argument.  But I still haven't seen evidence that Python is the wrong
tool for this project.

>I only see two ways to make this read well in Python: either add macros 
>(like Lisp, NOT like C) or add blocks that don't use lambda (like 
>Smalltalk or Ruby).  I prefer Python's syntax the way it is.

<raised eyebrow>  While I won't argue that the Lisp version of this
function looks a bit cleaner, I'm still of the opinion that if you
remove the need for ``lambda``, the Python version is easier to
understand.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"The joy of coding Python should be in seeing short, concise, readable
classes that express a lot of action in a small amount of clear code -- 
not in reams of trivial code that bores the reader to death."  --GvR



More information about the Python-list mailing list