Jonah Thomas wrote:
> pml540114@[EMAIL PROTECTED]
wrote:
>
>> Actually, I've been doing occasional work on a Forth variant with a
>> different compiler/interpreter that doesn't even have that, but has a
>> Reverse Polish naming approach. The basic idea, before syntactic
>> sugar, is that it compiles left to right in the usual way, building up
>> anonymous secondaries. Any unrecognised token terminates the current
>> anonymous secondary and is assigned as its name, and a new anonymous
>> secondary starts. At the end of the source string the final anonymous
>> secondary is closed off and run. Before syntactic sugar, ANY source is
>> valid!
If I'd known about this, I would have used this approach to bootstrap
LSE64. It's basically a primitive assembly language for a Forth VM.
Simple and clean. However, I wouldn't want to program anything complex
in it.
A programming language designer I knew long ago made the point that you
want a decent "Hamming distance" between syntactically correct programs:
otherwise you'll waste lots of time chasing down trivial typos.
Mostly you don't need a primitive assembler for programming by human
beings: a macro assembler is more useful. Traditional Forth is
essentially a rather kludgy macro assembler for the Forth VM. It would
help to clean this up, but to make the power of the Forth VM more
accessible to users we also need a real general purpose language for it,
I think.
>
> Interesting! I wonder if John Doty has seen this. Or Chuck Moore.
> There's a radical simplicity to it.
Yeah, but I got very busy. My VLSI customer surprised me by asking for
another design iteration (the last one met requirements, but they want
even more). And I got handed another electronic design job on a short
fuse.
And now, a very big astronomy project is starting, and two additional
proposals have won funding. Forth is looking pretty unattractive now, as
all of my projects are moving from concept to implementation, and the
challenge is more human communication than anything else. Forth's great
for trying things on the bench, but it's lousy for communicating ideas
to a large team.
Out of all the speculation about my personal life that people on this
group have attempted to avoid facing the points I make, you are the only
one who got something right: I sometimes get too busy to bother with
newsgroups.
>
>> This loses a lot of what most Forths are aiming for, like the other
>> defining words and maybe even immediate words, but I was just
>> testbedding something that doesn't need or want them anyway, so
>> workarounds are good enough there.
>
>> For further details, see
>> http://users.beagle.com.au/peterl/furphy.html.
>
>> (One possible variant:
>> terminate all anonymous secondaries with branches back to the
>> beginning so they default to infinite loops, and provide a conditional
>> return as the only essential explicit control construct.)
>> P.M.Lawrence.
>
> I'm troubled by what you call "false friends", commands that have the
> same name as Forth commands but radically different actions.
Compare "THEN" in traditional Forth to "THEN" in English or in other
programming languages. Forth has a long history of abusing familiar
symbols, so I can't see how you can object here.
> If you
> implement it in Forth that looks like it invites problems, and it
> shouldn't be too hard to make new names. But a quick look at your Pygmy
> code did show new names.
>
>
> It always seemed to me that Forth could be used like a functional
> language, at least in talking-dog style. ("You complain that he doesn't
> speak well, but it's remarkable he can talk at all.") Avoid variables
> etc and you can mostly avoid side effects. Often composition of
> functions is simple. If you don't mind strict evaluation then
>
> z = f(x);
> y = z * z;
>
> becomes
>
> : f ( ? -- z )
> ??? ;
>
> : y ( z -- z^2 )
> DUP * ;
>
> : y(f)
> f y ;
>
> And of course recursion is available etc.
>
> But you're taking it a lot further.
--
John Doty, Noqsi Aerospace, Ltd.
http://www.noqsi.com/
--
History teaches that logical consistency is neither sufficient nor
necessary to establish practical, real world truth. Those who attempt to
use logic for that purpose are abusing it.


|