Which kid's beginners programming - Python or Forth?

Ian Osgood iano at quirkster.com
Wed Jun 29 14:48:25 EDT 2005


Forth clarifications below...

Rocco Moretti wrote:
>
> So for Math you'd do something like:
>
> y = b + mx + cx^2
>
> IIRC, for Forth it would be something like (please excuse the mistakes
> in operator notation):
>
> x 2 ^ c * m x * + b + 'y' setvar

Assuming these are all VALUEs:

  x DUP * c * m x * + b + TO y

> [Portability]

Much Forth code you find on the net is written to the ANS standard, and
is thus portable.  Free standard Forth systems are available for all
platforms.

> There are ANS and IEEE standards for Forth, but official standards tend
> to leave things implementation dependent, especially in platform
> specific things like file access.

Standard I/O and file I/O are part of the ANS standard.

> To further compound the issue, a Forth
> system tends to be self contained and insular - interaction with the
> surrounding environment may be minimal at best. Python, where possible,
> tries to shield the user from platform specifics, while still allowing
> full access to the environment. There are a number of Python bindings to
> C libraries which give near complete control to the desktop/screen/sound
> system, etc. Forth-bound libraries will likely be rarer, and again,
> interpreter specific.

That is unfortunately true.  There are FFI (foreign function iterfaces)
available for the most popular Forth systems, but how they work is not
standardized.  Forth has nothing like the module libraries of Python.
Graphics, object-orientation, and data-types are all available or
easily implemented in a particular Forth, but those batteries are not
included as they are in Python.

Ian




More information about the Python-list mailing list