Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: What's righ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 44 of 45 Topic 4028 of 4285
Post > Topic >>

Re: What's right with FORTH and wrong with c.l.f.

by John Doty <jpd@[EMAIL PROTECTED] > Jul 5, 2008 at 12:29 PM

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.
 




 45 Posts in Topic:
What's right with FORTH and wrong with c.l.f.
Richard Owlett <rowlet  2008-04-30 16:14:51 
Re: What's right with FORTH and wrong with c.l.f.
mhx@[EMAIL PROTECTED] (M  2008-05-01 00:00:16 
Re: What's right with FORTH and wrong with c.l.f.
mhx@[EMAIL PROTECTED] (M  2008-05-01 10:54:15 
Re: What's right with FORTH and wrong with c.l.f.
Albert van der Horst <  2008-05-01 14:39:26 
Re: What's right with FORTH and wrong with c.l.f.
mhx@[EMAIL PROTECTED] (M  2008-05-01 10:59:29 
Re: What's right with FORTH and wrong with c.l.f.
Albert van der Horst <  2008-05-01 14:31:31 
Re: What's right with FORTH and wrong with c.l.f.
brian.fox@[EMAIL PROTECTE  2008-04-30 18:14:16 
Re: What's right with FORTH and wrong with c.l.f.
Jonah Thomas <jethomas  2008-05-01 02:58:08 
Re: What's right with FORTH and wrong with c.l.f.
"The Beez'" <  2008-05-01 03:51:29 
Re: What's right with FORTH and wrong with c.l.f.
Jonah Thomas <jethomas  2008-05-01 09:57:10 
string concatenation (was: What's right with FORTH ...)
anton@[EMAIL PROTECTED]   2008-05-01 15:28:43 
Re: string concatenation (was: What's right with FORTH ...)
stephenXXX@[EMAIL PROTECT  2008-05-01 22:53:25 
Re: string concatenation (was: What's right with FORTH ...)
anton@[EMAIL PROTECTED]   2008-05-02 19:02:14 
Re: What's right with FORTH and wrong with c.l.f.
John Passaniti <nntp@[  2008-05-01 22:17:22 
Re: What's right with FORTH and wrong with c.l.f.
Albert van der Horst <  2008-05-01 14:57:46 
Re: What's right with FORTH and wrong with c.l.f.
Bruce McFarling <agila  2008-05-01 13:04:35 
Re: What's right with FORTH and wrong with c.l.f.
Jonah Thomas <jethomas  2008-05-01 18:34:31 
Re: What's right with FORTH and wrong with c.l.f.
Dick van Oudheusden <d  2008-05-02 03:07:49 
Re: What's right with FORTH and wrong with c.l.f.
Richard Owlett <rowlet  2008-05-02 15:58:00 
Re: What's right with FORTH and wrong with c.l.f.
Bruce McFarling <agila  2008-05-02 04:51:55 
Re: What's right with FORTH and wrong with c.l.f.
Aleksej Saushev <asau@  2008-05-02 22:02:30 
Re: What's right with FORTH and wrong with c.l.f.
Marc Olschok <nobody@[  2008-05-02 18:20:38 
Re: What's right with FORTH and wrong with c.l.f.
Aleksej Saushev <asau@  2008-05-03 09:56:47 
Re: What's right with FORTH and wrong with c.l.f.
Marc Olschok <nobody@[  2008-05-03 20:16:22 
Re: What's right with FORTH and wrong with c.l.f.
Aleksej Saushev <asau@  2008-05-04 23:59:26 
Re: What's right with FORTH and wrong with c.l.f.
Marc Olschok <nobody@[  2008-05-05 21:45:18 
Re: What's right with FORTH and wrong with c.l.f.
Aleksej Saushev <asau@  2008-05-07 21:46:15 
Re: What's right with FORTH and wrong with c.l.f.
Marc Olschok <nobody@[  2008-05-12 18:20:59 
Re: What's right with FORTH and wrong with c.l.f.
stephenXXX@[EMAIL PROTECT  2008-05-04 18:46:53 
Re: What's right with FORTH and wrong with c.l.f.
Richard Owlett <rowlet  2008-05-02 16:04:39 
Re: What's right with FORTH and wrong with c.l.f.
Bruce McFarling <agila  2008-05-02 11:45:25 
Re: What's right with FORTH and wrong with c.l.f.
Aleksej Saushev <asau@  2008-05-03 11:44:38 
Re: What's right with FORTH and wrong with c.l.f.
Aleksej Saushev <asau@  2008-05-03 11:57:11 
Re: What's right with FORTH and wrong with c.l.f.
Elizabeth D Rather <er  2008-05-03 07:27:16 
Re: What's right with FORTH and wrong with c.l.f.
Aleksej Saushev <asau@  2008-05-04 23:26:57 
Re: What's right with FORTH and wrong with c.l.f.
John Passaniti <nntp@[  2008-05-05 21:41:12 
Re: What's right with FORTH and wrong with c.l.f.
stephenXXX@[EMAIL PROTECT  2008-05-07 10:16:30 
Re: What's right with FORTH and wrong with c.l.f.
Dick van Oudheusden <d  2008-05-04 03:04:44 
Re: What's right with FORTH and wrong with c.l.f.
Bruce McFarling <agila  2008-05-05 16:35:43 
Re: What's right with FORTH and wrong with c.l.f.
astrobe <fdubois76@[EM  2008-05-07 05:08:02 
Re: What's right with FORTH and wrong with c.l.f.
Alex McDonald <blog@[E  2008-05-07 05:56:35 
Re: What's right with FORTH and wrong with c.l.f.
pml540114@[EMAIL PROTECTE  2008-05-15 06:21:25 
Re: What's right with FORTH and wrong with c.l.f.
Jonah Thomas <jethomas  2008-05-15 21:31:30 
Re: What's right with FORTH and wrong with c.l.f.
John Doty <jpd@[EMAIL   2008-07-05 12:29:00 
Re: What's right with FORTH and wrong with c.l.f.
pml540114@[EMAIL PROTECTE  2008-05-15 19:08:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 13:37:58 CDT 2008.