Forth discussions 
Author Message
 Forth discussions

To the members of the comp.lang.forth discussion group:

I thought I might contribute to the discussions on how to promote Forth
on the Web, and perhaps find out if my question has already been
answered.  I've noticed that there are many Forth implementations
available for download on the internet.  Although I'm not too familiar
with the terms, compilation and interpretation come up often as
requisite steps for the final execution of the source code.  But none of
the programs that I've downloaded seem to have the following steps
clear:  1) writing the Forth code  2)  compilation--interpretation  and  
3) execution.  The tutorials concentrate on understanding the different
tools used to tackle a programming problem in order to write the code,  
with little or no reference to steps 2 and 3.  Probably it is thought
that those subjects are too complicated for a tutorial, but one of the
fundamental features of Forth which makes it so attractive is what is
called interactive programming.  From the very beginning, a student can
write a program and see it executed right away, as in defining a word.  
If he could also, from the beginning see the process thru to the actual
application in the form of an executable file it would probably not give
him an exhaustive understanding of compilation--execution, but at least
basic principles relating to the OS, and the acquisition of skills in
handling basic routines of his computer would be a valuable consequence
and asset.  I've had many questions too numerous to mention in trying to
learn Forth on the internet, but this sums it up.  The folks at
comp.lang.forth are very helpful and I think that if I could order my
queries in a straightforward manner, perhaps we could start an online
tutorial of sorts.  Those who are more familiar with the language and
its history will perhaps be more inclined to the approach mentioned.  On
a basic level, Forth has similarities with the very first computer, that
of Charles Babbage.  I/O,  variable cards and fixed cards (data stack),
and actual programs (saved variable cards).  There really was no
'language', only programs that had been saved and worked well in
developing further programs.  This is what we call a computer language.  
For a beginner it is more important to understand first of all the
routines of his machine, and how familiarity with the language is added
on only afterwards as the need arises.  This will inspire more
confidence and resourcefulness on the part of the programmer, and a
willingness to teach others who are new to computers, or for that
matter, to the Forth language itself.

Roy
--
http://www.*-*-*.com/



Sat, 20 Mar 2004 08:29:06 GMT  
 Forth discussions

Quote:

> To the members of the comp.lang.forth discussion group:

> I thought I might contribute to the discussions on how to promote Forth
> on the Web, and perhaps find out if my question has already been
> answered.  I've noticed that there are many Forth implementations
> available for download on the internet.  Although I'm not too familiar
> with the terms, compilation and interpretation come up often as
> requisite steps for the final execution of the source code.  But none of
> the programs that I've downloaded seem to have the following steps
> clear:  1) writing the Forth code  2)  compilation--interpretation  and
> 3) execution.  The tutorials concentrate on understanding the different
> tools used to tackle a programming problem in order to write the code,
> with little or no reference to steps 2 and 3.

The principle reason that operational issues aren't discussed by the
tutorials is they vary a lot from one Forth implementation to another.
The tutorials are intended to be generic, usable with any Forth.

Generally it's considered the responsibility of a system implementor
to provide operational documentation of this sort.  You don't say
which versions you've tried; some of the free versions have very
little documentation, although some are better.  There are free
evaluation versions of the commercial products, such as those
offered by my company (www.forth.com) and MPE.  You'll find
these to be extensively documented, usually with PDF manuals.

If you need operational assistance with the Forths you already
have, and they aren't accompanied by operational documentation,
you'll need to tell us which Forth, and doubtless there will be folks
here that know it and can help.

Cheers,
Elizabeth

--
================================================
Elizabeth D. Rather   (US & Canada)       800-55-FORTH
FORTH Inc.                                      +1 310-491-3356
5155 W. Rosecrans Ave. #1018  Fax: +1 310-978-9454
Hawthorne, CA 90250
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
================================================



Sat, 20 Mar 2004 08:59:48 GMT  
 Forth discussions
Roy,

Those are interesting observations.  I think the
issue is basically that Forth tutorials on the
web are mostly generic Forth tutorials rather
than manuals for specific Forths that give the
kinds of OS interface details that you want.

You might try Forth Inc's free evaluation version
of Swiftforth as it includes detailed manuals
with the kind of product specific documenation
that you are looking for.  Or get the Gforth
manuals or the FPC user manuals or whatever
specific program manual that you need.

In many implementations of Forth the OS is Forth.
There is no interface to a host OS and there may
not be source files.  These systems are already
outside of the scope of the questions that you
asked about Forth uses the host OS files.  Do
you see the problem?

Bottom line is that file set words in ANS Forth
are portable but many Forth products that use a host
OS file system will use words that are not
portable in the same way.

Quote:
> But none of
> the programs that I've downloaded seem to have the following steps
> clear:  1) writing the Forth code  2)  compilation--interpretation
> and 3) execution.  

You are probably looking for some standard external
host OS file access words and proceedures in the language
that just are not there.  Since Forth may use any of
a number of different external OSes and file systems
or may be the OS or have no files you really need a
user manual for a Forth with the OS hooks that you
need to the OS that you want.

Most tutorals are generic.  To define a program named
MYWORLD that prints out HELLO WORLD by typing

: MYWORLD ( -- ) ." HELLO WORLD" ;

So I have covered #1, writing the code.

Now I can interpret that code by typing

MYWORLD

or I can compile my program into another program
in a new definition by typing

: NEWDEF ( -- ) MYWORLD CR ." copyright 2001" ;

ok that covers #2, compilation-interpretation

then they may cover how to  switch between
compilation and interpretation inside of program

: DEMO ( -- ) MYWORLD [ MYWORLD ] ;

DEMO compiles MYWORD and also interprets
the definition of MYWORD while compiling DEMO.

That covers everything but execution.

To execute MYWORLD I can type MYWORLD
or I can type DEMO or NEWDEF.

That is the sort of generic tut{*filter*}that you find
on the web because, that is generic Forth.  As
soon as you start to talk about how do you
save an executable file in a specific HOST OS
and specific system implemenation details you
no longer have a generic Forth tutorial you
have a product tutorial.

Quote:
> The tutorials concentrate on understanding the different
> tools used to tackle a programming problem in order to write the code,
> with little or no reference to steps 2 and 3.  Probably it is thought
> that those subjects are too complicated for a tutorial,

No, I think it is just that all these steps are so simple
because it all works out of a name/code dictionary not a file system
and the interpreter/compiler interfaces are not as complicated
as what you are looking for.

Quote:
> but one of the
> fundamental features of Forth which makes it so attractive is what is
> called interactive programming.  From the very beginning, a student can
> write a program and see it executed right away, as in defining a word.

right.  type a few lines, define, compile, interpret, test
you code in a few seconds if you want rather than open a
project and define a source program and a makefile and
edit the sources and compile them and link them and create
an executable file and perhaps add other object links
or a desktop icon etc.

Some Forths can do those things but it is beyond the
scope of generic Forth so it isn't covered in generic
Forth tutorials.

Quote:
> If he could also, from the beginning see the process thru
> to the actual application in the form of an executable file

There you go.  You are making lots of assumptions like that there
is a external host OS with file system that will contain the
compiled code.  Using a specific foreign host OS and file system
for containing executable programs is not part of the
generic Forth language.  Remember many Forths have no file
system so your question doesn't match what Forth is and
is a little difficult to answer.

Quote:
> it would probably not give
> him an exhaustive understanding of compilation--execution, but at least
> basic principles relating to the OS,

You want an OS tutorial and specific OS interface tutorial
for a specific Forth system with the specific details of how
it will generate the executable files that you want.  But
it isn't done exactly the same way in DOS, Linux, Windows
etc. and just isn't generic.  Get the documentation for
FPC or Gforth or Swiftforth or whatever it is that you
need since you won't find that stuff in generic Forth
tutorials.

Quote:
> and the acquisition of skills in
> handling basic routines of his computer would be a
> valuable consequence and asset.  
> I've had many questions too numerous to mention in trying to
> learn Forth on the internet, but this sums it up.  The folks at
> comp.lang.forth are very helpful and I think that if I could order my
> queries in a straightforward manner, perhaps we could start an online
> tutorial of sorts.  Those who are more familiar with the language and
> its history will perhaps be more inclined to the approach mentioned.  On
> a basic level, Forth has similarities with the very first computer, that
> of Charles Babbage.  I/O,  variable cards and fixed cards (data stack),
> and actual programs (saved variable cards).  There really was no
> 'language', only programs that had been saved and worked well in
> developing further programs.  This is what we call a computer
> language.

I can sort of imagine a Forth running on Babbage's machine
(Forth is so simple it can run on most computers)
but I do have a hard time imagining the how that Forth
would interface to the Windows OS (tm) on that machine. ;-)

Quote:
> For a beginner it is more important to understand first of all the
> routines of his machine, and how familiarity with the language
> is added on only afterwards as the need arises.  

That is why generic Forth tutorials often start with
an explanation of the Forth virtual machine and the
most primitive stack operations like DUP and DROP
and why they then skip ahead to : and ; to compile
words for interpretation or further compilation.
Then they tend to cover flow control ( IF ELSE THEN
BEGIN UNTIL ... DO LOOP etc.) then the time
phases of design (edit), compile and run times
and the words to control compilation and interpretation
modes.  They may cover other generic Forth stuff
covered by the standard.

User manuals on the other hand usually have sections
on the program interfaces to specific foreign OS
interfaces if they include such things.  It may
be simple on some systems but it isn't portable
in the same way as the stuff that relates to the
Forth virtual machine.

SAVE-EXE, TURNKEY, TARGET-COM or other such non-generic
commands are the sort of thing that you need
to generate OS specific executable files in the
Forths that can do that stuff.  Generic Forth deals with
the virtual machine but some Forths also deal with external
OS details in their own way, whatever is appropriate.

Quote:
> This will inspire more
> confidence and resourcefulness on the part of the programmer, and a
> willingness to teach others who are new to computers, or for that
> matter, to the Forth language itself.

> Roy



Sat, 20 Mar 2004 09:31:41 GMT  
 Forth discussions

Quote:

> If you need operational assistance with the Forths you already
> have, and they aren't accompanied by operational documentation,
> you'll need to tell us which Forth, and doubtless there will be folks
> here that know it and can help.

Thank you Elizabeth.  Part of the problem with the operational
documentation for a beginner is that the terminology, though useful in
communicating computing theories among the computer scientists, makes
learning computer languages very difficult, because the terminology in
which they are expressed refers to specific machine instructions that
are understood by convention only, not by practical concerns.  These
conventions are what make it impossible to understand computer science
without understanding computer languages and vice-versa.  The advantage
of this situation is that all languages have an equal footing, that is
the specific merits and disadvantages of each can be discerned by the
trained scientist, but on the other hand it creates a gulf between the
computer programmers and the engineers who build computers.  For this
reason it is important for computer science as such to have a well
defined sphere of activity.  Thus instead of learning how to use one
language in order to learn another, one can understand how the first
language operates the hardware and why, and this way freely choose to
learn the language that suits us.
     Of the Forths that I have, only kForth specifically mentions that
it is compatible with Windows 2000.  Its documentation can be found
here:  http://ccreweb.org/software/kforth/kforth.html.  This would be my
first choice if I were convinced that I had to learn Windows 'C' and all
other computer languages in the process of learning Forth.  But common
sense tells me that it need not be the case.  Can the basics of the
computers harware functions be expressed in a simple enough way to make
learning Forth by itself possible?  A project which has all the
potential of doing that is perhaps that of Mr. Moore himself.  His
colorForth does not run on my machine, possibly because I don't have the
right monitor (I have a VESA/60 and it requires a VESA/117).  Another is
jeForth, the java applet of which does not run with my Java 2 runtime
environment, possibly for a similar reason.  Then there is the eForth
model of C. H. Ting.  In the Readme file he says it is simple:
"eForth is a simple Forth model which can be easily ported to a wide
range of CPU's.  It is best put into ROM and communicate to the
outside through a serial RS232 line.  Files can be downloaded through
the serial line also.  This eForth Model includes an implementation
on IBM-PC.  The assembly source code is designed so that one can use
MASM to assemble object code for any target CPU.  Only 29 words are
coded in machine instructions, which can be easily modified to run
on a target CPU other than 8086.  The eForth Model and the IBM-PC
implementation is in the public domain to encourage interested
programmers to port this model to different CPU's."
Now if we knew what any of that meant, and had appropiate references,
including explanations of how Forth programming controls what is going
on in terms of concrete programs and applications, it would make
learning Forth a real joy.  This is the most challenging of the Forths
that I have, because one can build ones one Forth.  It is also the one
with the least documentation.  But as it is I do not understand any of
the Forth documentation. The question it seems is, can there be an
objective way of understanding the computer hardware specifically for
the purpose of studying Forth applications?  I'd appreciate any
suggestions.

Roy

--
http://listen.to/Baha



Sat, 20 Mar 2004 13:12:23 GMT  
 Forth discussions


Quote:
> Roy,

> Those are interesting observations.  I think the
> issue is basically that Forth tutorials on the
> web are mostly generic Forth tutorials rather
> than manuals for specific Forths that give the
> kinds of OS interface details that you want.

> You might try Forth Inc's free evaluation version
> of Swiftforth as it includes detailed manuals
> with the kind of product specific documenation
> that you are looking for.  Or get the Gforth
> manuals or the FPC user manuals or whatever
> specific program manual that you need.

> In many implementations of Forth the OS is Forth.
> There is no interface to a host OS and there may
> not be source files.  These systems are already
> outside of the scope of the questions that you
> asked about Forth uses the host OS files.  Do
> you see the problem?

Yes.  It just seems to me that the tutorials, though generic, are
generic to computer languages in general, and many of the terms used to
express the behaviour of a Forth program are borrowed from languages
with which it has little in common.  If Forth really had nothing to do
with OS, the behaviour of the computer programs should not be expressed
in such complicated terms.  It really makes it as difficult as learning
an ordinary human language and that's contrary to logic because a
computer can't be as complicated as a person.  Maybe there is a simple
explanation that has just passed me by, however I'm certain that the
'tutorials' are not meant for people with no programming experience.  
Just where they learn to actually program is a mystery to me.  Is it
really word of mouth, as Mr. Ting says (in Zen koans?).

--
http://listen.to/Baha



Sat, 20 Mar 2004 15:07:45 GMT  
 Forth discussions

Quote:

> Yes.  It just seems to me that the tutorials, though generic, are
> generic to computer languages in general, and many of the terms used to
> express the behaviour of a Forth program are borrowed from languages
> with which it has little in common.  If Forth really had nothing to do
> with OS, the behaviour of the computer programs should not be expressed
> in such complicated terms.  It really makes it as difficult as learning
> an ordinary human language and that's contrary to logic because a
> computer can't be as complicated as a person.  Maybe there is a simple
> explanation that has just passed me by, however I'm certain that the
> 'tutorials' are not meant for people with no programming experience.
> Just where they learn to actually program is a mystery to me.  Is it
> really word of mouth, as Mr. Ting says (in Zen koans?).

It is still a mystery to me what you're after.

Or is the key "Just where they learn to actually program is a mystery
to me?" The Forth tutorials I've seen are not designed to teach
you to program, they teach the mechanics of the Forth language.

Forth tutorials in particular are not trying to convince anybody they
should program something at all. They all expect you to have a goal
and purpose already. In my zealot days, I found most newbies and
beginners struggled exactly with this fact: what to program and why.
It's not a bad attitude in general, but it is not an easy path with
Forth. The answer is: either read Starting Forth and Thinking Forth,
or investigate some other programming languages first.

The recommended way is of course to read all of Don Knuth's books
cover to cover and work all the exercises (after writing your own
MIX).

-marcel



Sat, 20 Mar 2004 15:30:47 GMT  
 Forth discussions

Quote:

> Then there is the eForth model of C. H. Ting.  

Just as a small clarification Bill Muench is the
author of eForth and the designer of the model
that it uses.  Bill doesn't say whether the e
in eForth stands for easy, embedded, or
educational.  Bill's version for the 8086 can
compile to a 16 or 32 bit mode version and
includes to simply revector I/O though DOS
files.

Dr. Ting has distributed a stripped down
subset of Bill's kernel for use with a
reduced model of the language, one for embedded
processing where the only I/O supported is
a serial line.

Quote:
> In the Readme
> file he says it is simple: "eForth is a simple Forth model
> which can be easily ported to a wide range of CPU's.  It is
> best put into ROM and communicate to the outside through a
> serial RS232 line.  Files can be downloaded through
> the serial line also.  This eForth Model includes an implementation
> on IBM-PC.  The assembly source code is designed so that one can use
> MASM to assemble object code for any target CPU.  Only 29 words are
> coded in machine instructions, which can be easily modified to run
> on a target CPU other than 8086.  The eForth Model and the IBM-PC
> implementation is in the public domain to encourage interested
> programmers to port this model to different CPU's."

Yes, that is all true and expresses the facts clearly
and accurately.  It is even gramatically correct which
is somewhat unusual for Dr. Ting's English language
documents.

Quote:
> Now if we knew what any of that meant,

???

Perhaps I can explain it for you:

Quote:
> file he says it is simple: "eForth is a simple Forth model
> which can be easily ported to a wide range of CPU's.  

Right. the eForth model is simple because it has a simple
compiler written in high level Forth that is about as
simple and portable as any Forth out there.  It has been
ported to at least 50 CPU.  Ting offers about that
many different versions in his store alone.  It can be
ported to a new CPU by a Forth expert in as little as
a couple of hours and a couple of days for a Forth
newbie.

Quote:
> It is
> best put into ROM and communicate to the outside through a
> serial RS232 line.  

The way Ting is using eForth is as a portable embedded Forth
model.  It is simpler than the old FIG Forth model that
supported a display, a keyboard and a mass storage device
with blocks. It contains its own OS in three of primitive
words in assembler.  It is simpler than old tiny Forths
like FIG Forth because it has no words to support a display
or a keyboar or a mass storage device.  It is simpler
than more modern Forths that have file systems or file
system interfaces or windows interfaces that require
tens of thousands of words.  It is simpler than
more sophisticed Forths with compilers that support
native code optimization, OS interfaces, editors,
tool sets, etc.

Quote:
> Files can be downloaded through the serial line also.  

Right.  If you use the supplied smart terminal software
on your PC as the HOST computer for embedded development
you can have source files on your PC instead of typing
your programs interactively over the serial line you
can vector them in from your source files on the
PC and compile source files in your eForth on the
tiniest of chips.  

You have a Forth on some $1 chip, so what can you
do with it?  Even if it has no video display or lcd
and no standard keyboard you can not only put
embedded Forth programs into its ROM but you can
compile source files from any sort of device over
the serial line on your embedded Forth machine.

Quote:
> This eForth Model includes an implementation
> on IBM-PC.  

Right. The most antique 8086 version of Bill's code
with most of the words removed is included in Forth
and assembler sources.  The Forth sources are
de-emphasised because Ting felt that metacompilation
was what was holding Forth back.  Ting wanted something
like the old FIG Forths in assembler but even simpler.
Ting wanted something that someone with a little background
could understand inside and back very quickly.

Quote:
> The assembly source code is designed so that one can use
> MASM to assemble object code for any target CPU.  

Yes.  Ting did something very Forth-like, he modified
the SEE that was only a few lines anyway to produce
output in MASM format.  With that on Bill's system
he simply revectored the output of SEE to a file,
edited it a little and had a MASM format source
that could produce the original Forth system
using the popular macro assembler for PCs.  

Anyone with a little knowledge of a PC and the
macro assembler and some knowledge of their
favorite new chip could use the PD stuff to
generate a portable ANS compatible Forth
compiler that runs on their target chip
and can compile ANS Forth programs.  It just
involves writing about 28 simple short
words in machine code or assembler for your
target processor and the rest is just
simple portable Forth code.

Quote:
> Only 29 words are
> coded in machine instructions, which can be easily modified to run
> on a target CPU other than 8086.  

Right.  As I say it has been ported to at least 50 machines
maybe hundreds. I have done a number of versions for
machines that have only been simulated.  29 is not the
absolute minium number of words that need to be in assembler
for a system that is mostly in Forth and it is a compromise
between simplicity, portability, and performance.

It is very simple, very portable and very low performance.
But even so Bill's simple multitasker in his eForth
even in all high level Forth is very fast compared
to many multitaskers.  About the only Forths slower than
eForths are ones that have only a half dozen words in
assembler or that are built on top of some other slow
high level language.

Quote:
> The eForth Model and the IBM-PC
> implementation is in the public domain to encourage interested
> programmers to port this model to different CPU's."

Right.  Hundreds or thousands of people have played with this
stuff. I only know dozens personally but I know that when
Ting goes to China that the FIG groups are pretty large.

I was recently talking to Bernie Mentink about another
eForth port that he was working on for a popular new
tiny chip recently.  Ting wanted to get hundreds or
thousands of people playing with that PD stuff like
in the old FIG Forth days.   We had about 30 people
for the annual combined Silicon Valley, North Bay, and
Sacramento FIG chapter Forth Day last year.  Ting
remembers the days when we had 4,000 people attended
and has wanted his eForth project to be a new
FIG Forth like thing.

If you really didn't know "what any of that meant"
I hope it is clearer now.

Quote:
> and had appropiate references,

The appropriate references are of course the eForth
porting guide, the eForth user's manual, eForth and
Zen, and whichever of the 50 eForth versions
that you get from Dr. Ting's store or from FIG.
His store sells most of these manuals for
$15 to $25.  The eForth model and many versions
are in the public domain.  There are many
user manuals and tutorials that are free but
not all versions are free and the printed
manuals from Offete are not free.

(well the FIG store has not been in operation for
over a year but Offete (Ting) does have about 50
eForth products.)

Quote:
> including explanations of how Forth programming controls what is going
> on in terms of concrete programs and applications, it would make
> learning Forth a real joy.  

That was the idea.  But Ting didn't just want to teach
people how to program in Forth.   He wanted to teach
people all the concepts of the Forth virtual machine,
Forth OS, all the internals and all the sources,
techniques for create new Forth systems on new
processors, Forth methods, and Forth techniques
suitable for implementation in hardware.

In short he wanted to be able to teach someone
everything except metacompilation in the shortest
amount of time.  So he threw out most of the
words that programers actually use and
distributed a minimal system, a stripped
down kernel with a could extra words added
like SEE and WORDS.  

Some people have seen the project as the
biggest disaster for Forth to be seen in a
long time.

My biggest complaint has always been that
I was able to learn a lot more by studying
Bill's complete and nicely written complete
ANS Forth with various extensions version
of eForth and that I just sigh when dozens
or hundreds of Forth programms spend years
adding back to Ting's eForth the things
that Ting removed from Bill's eForth more
than ten years ago.

Quote:
> This is the most challenging of the Forths
> that I have, because one can build ones one Forth.  

It is a good Forth if you need something free that
can easily be ported to your favorite new chip but
I always suggest that you use a complete and
beautiful version from Bill rather than the
absolute minimal version from Dr. Ting.

If you haven't done a number of your own Forth
systems before I also recommend the eForth user's
guide and the Porting eForth manual and any
version of eForth that closely.

Of course what I liked best about eForth was
the way it solved the metacompilation problems
so elegantly but again, Ting threw out lots and
lots of nice stuff to make the serial only,
stripped down eForth kernel in assembler system.

Quote:
> It is also the one
> with the least documentation.  

No.  There are dozens or hundreds of systems with
less or no documenation.  Only a few have
more documenation and some of them have so much
more stuff in them that they have far less
low level tutorial type documenation than
Ting provides.  He provides you with three or
four printed manuals for only a few K of code.

Quote:
> But as it is I do not understand any of
> the Forth documentation.

You do not understand any of it?  If that is
true then perhaps you have just been trolling.

I hope that my explanations helped you see
a whole set of problems that you have imposed
on yourself.  If anyone else was confused by your
confusion I hope my explanations have helped them
too.

Quote:
> The question it seems is, can

...

read more »



Sat, 20 Mar 2004 19:14:26 GMT  
 Forth discussions
The button on my browser reads, "Reply", but this is really an addendum.

I'm glad to see that I'm not alone in my confusion. What Enobe is
looking for is as opaque to me as the Forth documents he reads are to
him. Perhaps an analogy will be helpful. If it gets winded, that's at
least in keeping with this thread.

I am a hardware designer. To build digital hardware, at first I put
tubes (later, semiconductors), resistors and capacitors together in
various combinations. The result was either worthless (rarely!) or a
device that accomplished what I or my client (or boss) wanted. The
elements of my designs were few, the combinations proverbially endless.

My world changed with the introduction of integrated circuits. (Some of
my earlier work was building machines to make them possible). Now I had
at my disposal prewired circuits to use a building blocks. At first,
only a few kinds, later more. I got good at connecting these to make the
functions I needed. (One package of four NAND gates properly
interconnected performs an XOR function, etc.) The process of building
things remained one of connecting the right parts in the right way, but
the emphasis shifted. The parts had well defined inputs and outputs.
They were more numerous, and a design was shaped by which parts could
efficiently contribute to it. With the arrival of medium- and large-
scale integration, keeping a{*filter*} of what was available was a chore.

There came a time when it was clearly better to build certain classes of
machines with a computer at its core than by hard wiring it. I learned
to program in assembly language because there were no compilers for
micros then. Assembly was a two-pass paper tape to paper tape process,
but even with the need for special tape handlers (I used movie reels) to
keep the tape from snarling and tearing, it was far better than writing
the bits by hand.

It turned out that I was pretty good at building programs that were
succinct and efficient. One professor of computer science was delighted
with my conversion of binary to Gray code. When he asked how I came to
develop the algorithm, I explained that I has simply strung the op codes
together as I would have connected gates in hardware. I don't know what
he made of that remark, but it clarified programming for me in a way
that not before occurred to me.

Programming is the art of making the program you want from the op codes
and language constructs you have available. Assembly language is an
analog of small- and medium-scale integrated circuits. High-level
languages are akin to large scale. (Forth is like an ASIC foundry. In a
way, on the highest language level of all.) You seem to be searching on
many levels for something that isn't there. Your original question left
me in the dark, and nothing since enlightened me. You wrote of Babbage's
difference engine, "There really was no 'language', only programs that
had been saved and worked well in developing further programs. This is
what we call a computer language." We have language without 'language'.
What does that mean?

Here's what I think you might mean; correct me if need be: Assembly
language has no grammar other than operand order. (Babbage and Lovelace
programmed in their assembly language.) It doesn't really qualify as a
language unless a manual of available integrated circuits with pinouts
qualifies also. You can write nifty programs in assembly (you can see a
bunch at http://www.*-*-*.com/ ). Language, but not 'language'; does that fit?

fortran and BASIC are languages in a fuller sense. They have grammar and
syntax, and add elements to the repertoire of actions that are
independent of the executing platform. You can know all the available
integrated circuits in all the families form all the makers and still
not be able to design binary-to-Gray and Gray-to-binary converters.
Similarly, you can know all the computer languages that ever were and
still not be able to write a decent program or run one that you have
source for. The tutorials you have been reading are about the Forth
language. They are not like a tutorial for a spreadsheet. You would
probably not like it if they were.

Jerry
--
Engineering is the art of making what you want from things you can get.
-----------------------------------------------------------------------

Quote:


> > Yes.  It just seems to me that the tutorials, though generic, are
> > generic to computer languages in general, and many of the terms used to
> > express the behaviour of a Forth program are borrowed from languages
> > with which it has little in common.  If Forth really had nothing to do
> > with OS, the behaviour of the computer programs should not be expressed
> > in such complicated terms.  It really makes it as difficult as learning
> > an ordinary human language and that's contrary to logic because a
> > computer can't be as complicated as a person.  Maybe there is a simple
> > explanation that has just passed me by, however I'm certain that the
> > 'tutorials' are not meant for people with no programming experience.
> > Just where they learn to actually program is a mystery to me.  Is it
> > really word of mouth, as Mr. Ting says (in Zen koans?).

> It is still a mystery to me what you're after.

> Or is the key "Just where they learn to actually program is a mystery
> to me?" The Forth tutorials I've seen are not designed to teach
> you to program, they teach the mechanics of the Forth language.

> Forth tutorials in particular are not trying to convince anybody they
> should program something at all. They all expect you to have a goal
> and purpose already. In my zealot days, I found most newbies and
> beginners struggled exactly with this fact: what to program and why.
> It's not a bad attitude in general, but it is not an easy path with
> Forth. The answer is: either read Starting Forth and Thinking Forth,
> or investigate some other programming languages first.

> The recommended way is of course to read all of Don Knuth's books
> cover to cover and work all the exercises (after writing your own
> MIX).

> -marcel



Sun, 21 Mar 2004 00:11:24 GMT  
 Forth discussions

Quote:


> > Yes.  It just seems to me that the tutorials, though generic, are
> > generic to computer languages in general, and many of the terms used to
> > express the behaviour of a Forth program are borrowed from languages
> > with which it has little in common.  If Forth really had nothing to do
> > with OS, the behaviour of the computer programs should not be expressed
> > in such complicated terms. <SNIP>

> It is still a mystery to me what you're after.

AGREED!

Quote:
><SNIP> The answer is: either read Starting Forth and Thinking Forth,
> or investigate some other programming languages first.

[ Author of above works is Leo Brodie. ]

YES, but for a reason that may not be obvious.

Speaking as a relative 'NEWBIE', Mr. Brodie's books convey a relatively
implementation independent explanation of "the why of FORTH". His
examples are functionally implementation dependent, BUT they are
'standalone' in the sense that they can be read and understood even if
no FORTH implantation of any sort is available. They are 'out of print'.
HOWEVER, your local library should be able to obtain them on
inter-library loan.

I also recommend purchasing _Forth Application Techniques_ published by
FORTH, Inc. (www.forth.com ). As the title page says "Adapted from
courseware developed for Forth training classes by FORTH, Inc." It
assumes nothing.

As others have stated, FORTH Inc. and MPE have demo versions with
documentation available. Download one or both. I am a FORTH Inc.
SwiftForth customer and am well satisfied.

Quote:

> The recommended way is of course to read all of Don Knuth's books
> cover to cover and work all the exercises (after writing your own
> MIX).

> -marcel

{*filter*}ic isn't he ;/  [ OK so I have an engineer not mathematician
mindset ;}


Sun, 21 Mar 2004 01:24:45 GMT  
 Forth discussions

Quote:

>> If you need operational assistance with the Forths you already
>> have, and they aren't accompanied by operational documentation,
>> you'll need to tell us which Forth, and doubtless there will be folks
>> here that know it and can help.

>Thank you Elizabeth.  Part of the problem with the operational
>documentation for a beginner is that the terminology, though useful in
>communicating computing theories among the computer scientists, makes
>learning computer languages very difficult, because the terminology in
>which they are expressed refers to specific machine instructions that
>are understood by convention only, not by practical concerns.  These
>conventions are what make it impossible to understand computer science
>without understanding computer languages and vice-versa.  The advantage
>of this situation is that all languages have an equal footing, that is
>the specific merits and disadvantages of each can be discerned by the
>trained scientist, but on the other hand it creates a gulf between the
>computer programmers and the engineers who build computers.  For this
>reason it is important for computer science as such to have a well
>defined sphere of activity.  Thus instead of learning how to use one
>language in order to learn another, one can understand how the first
>language operates the hardware and why, and this way freely choose to
>learn the language that suits us.

                               <snip>

If you can dig it up, look for FPC.COM, a DOS Forth using the 1983 Standard.
It not only came with source, but documentation, help files, and ( if you
look for it) a tutorial by CH Ting.

At  www.forth.org  look under compilers and download fpc36.zip. This will
give you everything but the tutorial. Where it is I don't know. It used to
be at www.taygeta.com   but it seems to have disappeared. I have it and will
try to upload a copy to taygeta. FPC is a bit simple minded for todays
programming, but much better than absorbing a full blown windows forth at
the start.

Forth is best thought of as a type of assembler, as data is moved around by
visible addresses.  It emulates a zero-register CPU. This means that
subroutines (Words), instead of locating data by addressable registers, find
them by their position in the data stack.

As you have discovered, there is a difference betrween learning a language,
and programming in that language. A study of source code, and of tweaking
existing code to your liking is a good beginning.

Walter Rottenkolber



Sun, 21 Mar 2004 10:35:18 GMT  
 Forth discussions

Quote:


> >> If you need operational assistance with the Forths you already
> >> have, and they aren't accompanied by operational documentation,
> >> you'll need to tell us which Forth, and doubtless there will be folks
> >> here that know it and can help.

> >Thank you Elizabeth.  Part of the problem with the operational
> >documentation for a beginner is that the terminology, though useful in
> >communicating computing theories among the computer scientists, makes
> >learning computer languages very difficult, because the terminology in
> >which they are expressed refers to specific machine instructions that
> >are understood by convention only, not by practical concerns.  These
> >conventions are what make it impossible to understand computer science
> >without understanding computer languages and vice-versa.  The advantage
> >of this situation is that all languages have an equal footing, that is
> >the specific merits and disadvantages of each can be discerned by the
> >trained scientist, but on the other hand it creates a gulf between the
> >computer programmers and the engineers who build computers.  For this
> >reason it is important for computer science as such to have a well
> >defined sphere of activity.  Thus instead of learning how to use one
> >language in order to learn another, one can understand how the first
> >language operates the hardware and why, and this way freely choose to
> >learn the language that suits us.
>                                <snip>

> If you can dig it up, look for FPC.COM, a DOS Forth using the 1983 Standard.
> It not only came with source, but documentation, help files, and ( if you
> look for it) a tutorial by CH Ting.

> At  www.forth.org  look under compilers and download fpc36.zip. This will
> give you everything but the tutorial. Where it is I don't know. It used to
> be at www.taygeta.com   but it seems to have disappeared. I have it and will
> try to upload a copy to taygeta. FPC is a bit simple minded for todays
> programming, but much better than absorbing a full blown windows forth at
> the start.

> Forth is best thought of as a type of assembler, as data is moved around by
> visible addresses.  It emulates a zero-register CPU. This means that
> subroutines (Words), instead of locating data by addressable registers, find
> them by their position in the data stack.

> As you have discovered, there is a difference betrween learning a language,
> and programming in that language. A study of source code, and of tweaking
> existing code to your liking is a good beginning.

> Walter Rottenkolber

I got a copy from J. V. Noble that I'm pretty sure I still have. What I
know I have is the files from the Version 3.5 installation, including
the help system and the user's manual:

F-PC USER'S MANUAL

F-PC Version 3.5, November 1989

F-PC is a public domain Forth system optimized for IBM-PC/XT/AT type of
computers under MS-DOS operating system.  It is supplied on a set of
four diskettes with all the source code and documentation.  Files are
all compressed in the .ARC format.  The diskettes are not copy protected
and the users are free to make backup copies and give copies to others.
The only exception is that Dr. Robert L. Smith reserved the copyright on
his software floating point package contained in the files SFLOAT.SEQ,
SFLOAT1.SEQ, SFLOAT2.SEQ, and SFLOAT3.SEQ.  This package is made
available for unlimited personal, non-commercial use.  If you want to
include the whole or part of this package in your product for sell at a
profit, you should obtain a license from Robert Smith.

This Manual is also in the public domain and the copyright is forfeited.
You are free to copy it and distribute it with the F-PC diskettes.
However, the accompanying F-PC Technical Reference Manual is copyrighted
by Dr. C. H. Ting.

As F-PC is produced on volunteer efforts and donated to the public
domain, the authors and the F- PC Working Group declined to bear
responsibility for any special, consequential or other damages on using
F-PC system for any application, although every possible effort was made
to ensure its integrity for correct operation.

Authentic copies of F-PC diskettes, F-PC Technical Reference Manual and
this F-PC User's Manual can be obtained from Offete Enterprises, Inc.
The diskette set is $25.00, the Technical Reference Manual is $30.00,
and this Manual is $20.00 plus handling and sales tax.

There are two versions of F-PC in circulation.  Version 2.25 was
released in November 1988.  All files were in the .ARC format.  Version
3.5 is released in November 1989 and files are in the .ZIP format.

Offete Enterprises, Inc.
1306 South B Street
San Mateo, CA 94402
Tel. (415) 574-8250

I'm actually using V 3.6, and will zip up and send what I have if it's
needed.

Jerry
--
Engineering is the art of making what you want from things you can get.
-----------------------------------------------------------------------



Sun, 21 Mar 2004 21:00:56 GMT  
 Forth discussions

Quote:


> >> If you need operational assistance with the Forths you already
> >> have, and they aren't accompanied by operational documentation,
> >> you'll need to tell us which Forth, and doubtless there will be folks
> >> here that know it and can help.

> >Thank you Elizabeth.  Part of the problem with the operational
> >documentation for a beginner is that the terminology, though useful in
> >communicating computing theories among the computer scientists, makes
> >learning computer languages very difficult, because the terminology in
> >which they are expressed refers to specific machine instructions that
> >are understood by convention only, not by practical concerns.  These
> >conventions are what make it impossible to understand computer science
> >without understanding computer languages and vice-versa.  The advantage
> >of this situation is that all languages have an equal footing, that is
> >the specific merits and disadvantages of each can be discerned by the
> >trained scientist, but on the other hand it creates a gulf between the
> >computer programmers and the engineers who build computers.  For this
> >reason it is important for computer science as such to have a well
> >defined sphere of activity.  Thus instead of learning how to use one
> >language in order to learn another, one can understand how the first
> >language operates the hardware and why, and this way freely choose to
> >learn the language that suits us.
>                                <snip>

> If you can dig it up, look for FPC.COM, a DOS Forth using the 1983 Standard.
> It not only came with source, but documentation, help files, and ( if you
> look for it) a tutorial by CH Ting.

> At  www.forth.org  look under compilers and download fpc36.zip. This will
> give you everything but the tutorial. Where it is I don't know. It used to
> be at www.taygeta.com   but it seems to have disappeared. I have it and will
> try to upload a copy to taygeta. FPC is a bit simple minded for todays
> programming, but much better than absorbing a full blown windows forth at
> the start.

> Forth is best thought of as a type of assembler,

Thanks for your help.  I'm sorry I wasn't able to understand your
previous post.  About FPC (same as F-PC?) I've seen Tim Hendtlasses'
tutorial at ftp://ftp.taygeta.com/pub/Forth/Literature/rtfv5.pdf  In the
Introduction he states that it is not meant for the computer novice.  
That being what I am, and following the lead from the post by Jerry
Avins, I've looked into Assembly language.  There seems to be a
comprehensive tutorial on the Web, at
http://www.ladysharrow.ndirect.co.uk/library/Progamming/The%20Art%20of%
20Assembly%20Language%20Programming/Chapter%201.htm
and generally more information for a beginner.  Jerry says that some
pretty nifty programs can be made with it.  It being closer to the
machine language than other computer languages, I suppose that a good
knowledge of it will be better suited for the general purposes that I
intend to study it for.

Quote:
> as data is moved around by
> visible addresses.  It emulates a zero-register CPU. This means that
> subroutines (Words), instead of locating data by addressable registers, find
> them by their position in the data stack.

> As you have discovered, there is a difference betrween learning a language,
> and programming in that language. A study of source code, and of tweaking
> existing code to your liking is a good beginning.

> Walter Rottenkolber

--
http://listen.to/Baha


Sun, 21 Mar 2004 21:49:14 GMT  
 Forth discussions

Quote:

>  Part of the problem with the operational documentation
>for a beginner is that the terminology, though useful in
>communicating computing theories among the computer
>scientists, makes learning computer languages very
>difficult, because the terminology in which they are
>expressed refers to specific machine instructions that
>are understood by convention only, not by practical
>concerns.  These conventions are what make it impossible
>to understand computer science without understanding
>computer languages and vice-versa.  The advantage
>of this situation is that all languages have an equal
>footing, that is the specific merits and disadvantages
>of each can be discerned by the trained scientist, but
>on the other hand it creates a gulf between the computer
>programmers and the engineers who build computers.  For
>this reason it is important for computer science as such
>to have a well defined sphere of activity.  Thus instead
>of learning how to use one language in order to learn
>another, one can understand how the first language
>operates the hardware and why, and this way freely
>choose to learn the language that suits us.

     You've described a little of the problem beginners have in
learning to write programs. But things are much worse than you
know. There is no such thing as computer science. Programing is
an art at best. It has more in common with witchcraft than
modern scholarship. People who use different computer languages
use the same English word to mean completely different things.
Forth programmers have this problem in the extreme. Whenever you
see the words "simple", "standard" or "portable" used by a Forth
programmer remember the meaning could be exactly the opposite of
what a non-programmer expects.

     There is no easy cure for this situation. Computer
programming changes the way the human brain works. People do not
normally communicate with machines using a code of on and off.
Most Forth programmers have the disadvantage of working alone,
not teaching real beginners, and have forgotten how they saw
things twenty years ago before they learned Forth. When you say
you do not understand an elementary fact, they don't understand
why you don't understand. If you persist, there might be a
hostile reaction. Do not let this discourage you. Forth is the
easiest computer language to learn. Its just that the
instructional materials are in a state of chaos. There are not
enough beginners who want to use Forth and demand better
documentation. Instructional material is not refined and
polished to meet the needs of beginners, or even put where
interested beginners can easily find topics and treatments that
will appeal to them. Forth programmers are eager to show their
skills, but they only concentrate on communicating with
machines. You can drag out what you need to know from them, but
you will have to be persistent.

     If you can describe what you want to compute, and what
computing environment you use or want to use, then you will get
good advice from comp.lang.forth. But that is not something a
beginner would even know. Other computer languages have
instructors who want to teach beginners and have made those
decisions for them. There are even many different approaches for
each language for students with different levels of experience.

     I was fortunate to learn about Forth in the 1980's when
there was an interest in reaching out to beginners. The best
book on elementary programming I ever saw was written for Forth.
Now the interest in teaching Forth has gone. That wonderful book
is out of print and few users of Forth care. We supposedly have
made modern improvements to Forth. But those changes make
learning Forth harder. I hope you will continue your study of
Forth and let us know what difficulties you encounter. Perhaps
it will encourage us to take the effort to make learning Forth
as easy as it should be.

--



Mon, 22 Mar 2004 02:59:45 GMT  
 Forth discussions

Quote:

  ...

> Thanks for your help.  I'm sorry I wasn't able to understand your
> previous post.  About FPC (same as F-PC?)

Yes.

Quote:
> I've seen Tim Hendtlasses'
> tutorial at ftp://ftp.taygeta.com/pub/Forth/Literature/rtfv5.pdf  In the
> Introduction he states that it is not meant for the computer novice.
> That being what I am, and following the lead from the post by Jerry
> Avins, I've looked into Assembly language.  There seems to be a
> comprehensive tutorial on the Web, at
> http://www.*-*-*.com/ %20Art%20of%
> 20Assembly%20Language%20Programming/Chapter%201.htm
> and generally more information for a beginner.  Jerry says that some
> pretty nifty programs can be made with it.  ...

That's not a good idea for you on a modern computer, such the one you're
reading this on. Writing a program isn't enough. Aside from turning the
assembly statements into executable code, saving it on disk, and getting
it into memory to executing it*, you need to get information into and
out of the computer. Otherwise, you couldn't know if the program ran and
wouldn't have reason to care. I/O is best done by the operating system,
and "connecting" your program to the operating system requires intimate
knowledge that you're not likely to have. The authors of high-level
languages have made that connection part of the behind-the-scenes
operation, which lets beginners get started.

Forth systems, F-PC included, have a built-in way to write assembly
code. The advantage is that you need only tie into the Forth, not the
operating system (or at least the BIOS). The nifty programs I pointed
you to were written by Steve Gibson, who is among the most talented
programmers I know of, and who is also an expert on computer hardware.

Jerry
____________________________
* All that can be done with available programs: editor, assembler,
de{*filter*}.
--
Engineering is the art of making what you want from things you can get.
-----------------------------------------------------------------------



Mon, 22 Mar 2004 05:57:27 GMT  
 Forth discussions

Quote:

> If you can dig it up, look for FPC.COM,

It's FPC.EXE (not a .COM file which is more limited in
terms of memory segments.)  It is available at forth.org
and there are a number of user contributed libraries.

It has a companion program TCOM.  The Target Compiler
produces native 8086 code .COM files on the PC and
also targets a number of other processors but the
FPC program itself is a .EXE and saves .EXE files.
Both are by Tom Zimmer who is also the author of
win32forth.  Tom has put some great stuff out there.
Chuck Moore has used FPC quite often which is
somewhat unusual for him.

Quote:
> a DOS Forth using the 1983 Standard.

There is also an extension package that makes it
mostly ANS compliant.  

Quote:
> It not only came with source, but documentation, help files,
> and ( if you look for it) a tutorial by CH Ting.

Ting has several tutorals and some very large and
detailed manual like the FPC User's guide.  But they
are printed manuals and not free.  They are available
as files on his new CD that contains lots of the
old FPC stuff and documentation, lots of his old eForth
stuff, and all his hardware designs in schematic
and VHDL source.  It is also not free, but for $25
it does include the source to many of his printed
manuals that would more expensive to buy separately.

Quote:
> At  www.forth.org  look under compilers and download fpc36.zip.
> This will give you everything but the tutorial. Where it is
> I don't know. It used to be at www.taygeta.com   but it seems
> to have disappeared. I have it and will
> try to upload a copy to taygeta. FPC is a bit simple minded for todays
> programming, but much better than absorbing a full blown windows
> forth at the start.

I think Richard Haskell wrote "the Forth course" and Ting
expanded it by adding even more basic "first, second,
and third" courses. Ting felt the Forth course was too
advanced for beginners but I think it is also available
at forth.org.

Happy dining,
Jeff Fox



Mon, 22 Mar 2004 06:21:09 GMT  
 
 [ 32 post ]  Go to page: [1] [2] [3]

 Relevant Pages 

1. Forth Discussion

2. OO Forth discussion.

3. COLDFORTH forth.cx Small discussion on HTML server

4. Espace de discussion Python francophone / French speaking place for Python discussions

5. Getting Forth related files (was: Forth primer/teaching Forth)

6. Forth in Forth vs. Forth in assembly language

7. Forth in Forth vs Forth in assembly

8. Forth in Forth vs. Forth in assembly language

9. AI for NDT Discussion Group - Current & Future Discussions

10. Discussions

11. Discussions

12. Control structures; discussion or proposal

 

 
Powered by phpBB® Forum Software