Why python???

Alex Martelli aleax at aleax.it
Sat Sep 6 19:04:48 EDT 2003


Terry Reedy wrote:

> 
> "Alex Martelli" <aleax at aleax.it> wrote in message
> news:8Um6b.34442$R32.1077180 at news2.tin.it...
> 
>> for a really wide range of tasks.  A language we're developing at
>> AB Strakt as part of the CAPS framework, for example, looks like...:
>>
>>    attribute salary is Currency
>>        "Salario mensile"
>>        restriction quantity(1)
>>
>>        on create code Python
>>            if value[0] < minimumSalary:
>>                value = [ minimumSalary ]
>>            return value
>>        %%
> 
> My reflexive reaction was 'ugh'.  My considered reaction is 'bravo'.

Glad you reconsidered;-).  I'm not enthusiastic about that %%, but we
found that relying on just indentation for that specific role (indicating
the end of embedded Python code and the return to the declarative
language) was quite error-prone (e.g. due to Python continuation lines),
so we decided we needed a marker of SOME kind or other right there,
and for now, until further development, it's that "%%" thingy.

> You have avoided the 'ghetto trap' that I think too many
> mini-languages fall into by trying to be more or less turing-complete
> with a proprietary syntax useless for any other task.  The Python
> 'humancode' fits pretty seamlessly into the declaration framework for
> two reasons: the common use of significant indentation and the
> semi-natural (versus chicken-scratch) look of Python.

True.  However, we're keeping our options open as to the possibility
of hosting other languages for "embedded code" in the future (not
likely, perhaps, but possible).


>> etc -- now THAT is a higher-level language than Python, and it's
>> a dream to use for directly transcribing into executable code the
>> results of ERD analysis for typical business applications to be
>> deployed as multi-layer clients/middleware/server distributed apps;
> 
> If your declaration form requires overall noticeably fewer written
> lines than the Python translation, then I probably could learn to like
> it too.

Yes, ratios of 2:1 to 3:1 are typical (and it's just that because the
generated Python is mostly made up of calls to libraries supplied
with the framework, of course).


>> suited.  Note that this language uses Python as its lower-level
>> embedded language; indeed the whole VVHL (very-very high-level)
>> program gets compiled into Python (by a Python-coded compiler, of
>> course) and executed as Python (by a Python-coded middleware, of
>> course -- resting on top of a very special Python-coded OODB and
>> feeding clients such as GUI ones, Web apps, and batch scripts --
>> all typically coded, of course, in Python).
> 
> I am curious: Will the CAPS marketers reveal or hide the fact that the
> readable procedural sublanguage is a *real* language that CAPS users
> can potentially use outside the CAPS box?

Judge for yourself by visiting www.strakt.com -- I think so far Strakt has 
been pretty good at promoting Python (other indicators that you may
not find on the site is that Strakt houses the PBF site & mailing lists,
the Strakt success story is on the success stories website, and next
year's Europython will apparently be in Göteborg, Strakt's hometown).

I see no reason to predict that would change.  While we will eventually
document the declarative language in great detail, we'd be unlikely to
do much more than point to "Python in a Nutshell" for documentation
of the "embedded-code procedural language";-).


Alex






More information about the Python-list mailing list