Python w/Forth Runtime????

Christopher Browne cbbrowne at acm.org
Sat May 18 17:26:21 EDT 2002


Oops! Tim Daneliuk <tundra at tundraware.com> was seen spray-painting on a wall:
> Christopher Browne wrote:
>> 
>> In the last exciting episode, Tim Daneliuk <tundra at tundraware.com> wrote::
>> > Gerhard Häring wrote:
>> >>
>> >> Tim Daneliuk wrote in comp.lang.python:
>> >> > Python does just what needs doing ... see the end of this piece for why:
>> >> >
>> >> >    http://www.tundraware.com/Technology/Bullet/
>> >>
>> >> What's the connection with the Subject of your posting?

>> > At the end of the piece I suggest that a "ideal" language would
>> > be one which has the paradigmatic richness of Python but whose
>> > runtime execution environment was reaslized in something very
>> > sleek and light like Forth.

>> > The overall article is about the dangers of locking into a single
>> > programming paradigm (like OO) for everything and that real world
>> > problems require multiple *simultaneous* paradigms for reasonable
>> > solutions.  I think Python is almost alone in trying to
>> > incroporate that very idea in the language.
>>
>> Python is not alone in this.
>> 
>> Common Lisp conspicuously supports multiple simultaneous paradigms.
>
> Could you expand on this a bit?  It has been a *very* long time since I
> even looked at Lisp, let along programmed it...

Approaches that are well-supported off the top of my head include:

-> Traditional procedural programming;
-> Functional/applicative programming (rather like Python's functional
   aspects);
-> Object oriented programming;
-> Rich sets of extendable data structures including complex
   structures like arrays, vectors, hash tables, lists, structures,
   objects with customizable sets of slots, ...
-> The SERIES package allows using Icon-like generators, with the
   corresponding ability to do lazy evaluation;
-> Macros allow constructing custom control structures;
-> Reader macros allow constructing custom syntax.

You can do "procedural" if you want; you can do "OO" if you want; you
can do "functional" if you want.  You're not forced to use stuff you
don't want (aside from being forced to use lots of parentheses :-)).

Contrast with Ruby (as an extreme case of 'single-paradigmic'); in
Ruby, _everything_ is an object, including numbers, which means that
_everything_ has to get fit into some part of the object hierarchy,
whether you wanted to care about that or not.  It's not a horrid
language at all, but you know you're getting into 'purely OO' when you
get into Ruby.

C++ would also be an example of a "multiparadigmic" language,
unfortunately one that's pretty ugly.  Its set of paradigms _includes_
OO as well as procedural programing.  You can write code that is
essentially non-OO in C++, just as you can in Python and Lisp.  (C++
doesn't offer FP or generators or a particularly powerful macro
system, from whence comes a lot of the pain of templates, but I
digress...)

Kendall pointed out Mozart/Oz as another "multiparadigmic" language;
it combines FP, constraint logic, OO, and distributed programming.
(If it wasn't so tied to running atop Emacs, I'm sure it would be more
popular.  Note that I say this as an unabashed fan of Emacs...)

I'd point at Ada as another such language.
-- 
(reverse (concatenate 'string "moc.enworbbc@" "sirhc"))
http://www.ntlug.org/~cbbrowne/languages.html
"I'd crawl over an acre of 'Visual This++' and 'Integrated Development
That' to  get to gcc, Emacs,  and gdb.  Thank you."
-- Vance Petree, Virginia Power



More information about the Python-list mailing list