Re: State of Forth 200x
- From: John Doty <jpd@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 05 Jun 2006 21:09:26 -0600
Jerry Avins wrote:
John Doty wrote:
Jerry Avins wrote:
I don't see why you can't create an input package that treats numbers
the way the calling program dictates. In addition of ACCEPT, you could
have ACCEPT-NUM, ACCEPT-FLOAT, ACCEPT-DOUBLE. For a little more effort,
you could write a GET-NUM that accepts a number type and a digit count
as input parameters (The one I can't give away allows editing the
displayed number via the cursor, and rejects unacceptable keys.)
If I'm going to do that, why not just write it in C? Would be harder to
use, but wouldn't be as intimidating to some people...
Because C would be harder to use (according to you).
The sort of Forth style you are advocating would make the application as hard to use as an application in C.
I think it's unreasonable to expect users to respect the difference
between 5. , 5 , and 5e . That's the program's job. It's fine is source
code, but not for user input.
In a scriptable system, user input *is* source code. There is no
distinction. That's a crucial advantage of Forth over many other
approaches. If I were to give that up, I would abandon Forth for this
kind of application.
The script is essentially one-time user input.
Eh? Absolutely not!
A simple command like:
readout
is also a script. One could addreviate it as:
r : readout
if that's handy. Then there are more complex commands/scripts like:
5.5 s3 !v
The dialect I use is a concatenative language with flow control, so:
5. s3 !v readout 4. s3 !v readout repeat
is a perfectly reasonable command/script that alternates readouts with different s3 settings. Script != definition. One might slap a name and a colon in front of it to make it a definition if that's handy, but that's not necessary.
Remember, I use a STOIC-descended dialect of Forth. In a STOIC dialect, the command language is the full compiled language, not an abridged interpreted pidgin as in a traditional Forth. Smart users exploit this advantage. This also makes it easy to get users into programming what they need: a definition is just a command with a name and a colon in front of it. The programming language and the command language are the same. Is this why traditional Forth users have trouble understanding the power of the Forth approach here? I'd think that an over reaction: traditional Forth is hobbled, but it's not completely crippled.
The numbers are put in
repeatedly. I'm discussing number entry here.
A command is just a line of code. It might include one or more literal numbers. If number entry is special, commands become distinct from other definitions, and a barrier appears between the users and writers of commands.
--
---
John Doty, Noqsi Aerospace, Ltd.
---
His diagnosis of the hostility ... reflects the willful blindness of the invader who assures himself that the natives are only made unfriendly by some other provocation than his own. -Barbara W. Tuchman
.
- Follow-Ups:
- Re: State of Forth 200x
- From: Jerry Avins
- Re: State of Forth 200x
- References:
- Re: State of Forth 200x
- From: Jerry Avins
- Re: State of Forth 200x
- From: John Doty
- Re: State of Forth 200x
- From: Jerry Avins
- Re: State of Forth 200x
- From: John Doty
- Re: State of Forth 200x
- From: Jerry Avins
- Re: State of Forth 200x
- Prev by Date: Re: RfD: Separate FP Stack
- Next by Date: Re: Influences on Moore & other Qs
- Previous by thread: Re: State of Forth 200x
- Next by thread: Re: State of Forth 200x
- Index(es):
Relevant Pages
|