Re: State of Forth 200x



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
.



Relevant Pages

  • Re: Clear command window?
    ... I do do plenty of VB6 still. ... killed off the language. ... they killed my programming career-- it was the worlds' most popular ... Select the command and in the 'Press shortcut ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Overflowing a Long
    ... Maybe you had to "grow up" on a command line to appreciate the clarity ... strictly in terms of 3GLs or even machine language. ... I would guess that you probably started programming even earlier ... and thus you're more deeply entrenched in the programming style ...
    (microsoft.public.vb.general.discussion)
  • Re: Programming languages for the very young
    ... but a real programming course). ... from the lowest levels of assembler and assembly language ... FROM-APPLET CORE ... command. ...
    (comp.lang.java)
  • Re: How does a "script" differ from a "program" or "subroutine"?
    ... > Python is more a programming language than a scripting ... > language, although you can very ... language and interpreted programming language ... command shell, but could be a REXX compatible editor, or other ...
    (comp.lang.python)
  • Re: Wordsearch:AI Insanity
    ... bios, what with being hard-coded and all. ... Stop with an error message. ... an undefined command or something, so what happens depends entirely on ... So it's programmed to alter its own programming depending on input? ...
    (rec.arts.sf.composition)