[Edu-sig] Another Forth remark
Kirby Urner
pdx4d@teleport.com
Fri, 13 Oct 2000 09:56:29 -0700
>Very simplistic approach to that: (paste this into my script)
>
>def shell():
> """
> a simple interactive shell
> """
> print "Forth command line. Type 'quit'<RET> to quit."
> while 1:
> print ">",
> x = raw_input()
> if x=="quit":
> break
> execute(x)
OK, I'll give that a try. Sounds like fun.
>> As I recall, Python actually ships with a class designed to
>> provide a user prompt. You could subclass this, and a parser,
>> which automatically analyzes user input into tokens somehow.
>
>Don't know - which class do you mean?
I'll have to poke around -- just a dim recollection, could have
been in a book vs. part of the Standard Library.
>> My friend Ron was writing a book on FORTH and one point,
>> and I think even a compiler, but so far as I know, that
>> whole project reached a dead end, perhaps because FORTH
>> stopped being so "hot".
>
>When he was able to write a book about Forth, he
>*surely* also wrote a Forth compiler... There's not much
>of a difference between "programming in FORTH"
>and "modify it's compiler".
>
>Dipl.Inform. Dirk-Ulrich Heise
>hei@adtranzsig.de
>dheise@debitel.net
FORTH sounds like a very fun language (I recall enjoying
reading about it). I like the idea of introducing prefix
and postfix notation in the same lesson plan. Plus I'm
all for expanding on the concept of "data structures" in
K-12 [1] and FORTH provides a great opportunity to talk
about the stack structure.
Kirby
[1] http://www.inetarena.com/~pdx4d/ocn/trends2000.html