version 1.45, 1997/03/11 16:00:38
|
version 1.48, 1997/04/10 15:00:06
|
Line 3
|
Line 3
|
@comment %**start of header (This is for running Texinfo on a region.) |
@comment %**start of header (This is for running Texinfo on a region.) |
@setfilename gforth.info |
@setfilename gforth.info |
@settitle Gforth Manual |
@settitle Gforth Manual |
|
@dircategory GNU programming tools |
|
@direntry |
|
* Gforth: (gforth). A fast interpreter for the Forth language. |
|
@end direntry |
@comment @setchapternewpage odd |
@comment @setchapternewpage odd |
@comment %**end of header (This is for running Texinfo on a region.) |
@comment %**end of header (This is for running Texinfo on a region.) |
|
|
Line 99 personal machines. This manual correspon
|
Line 103 personal machines. This manual correspon
|
* Concept Index:: A menu covering many topics |
* Concept Index:: A menu covering many topics |
@end menu |
@end menu |
|
|
@node License, Preface, Top, Top |
@node License, Goals, Top, Top |
@unnumbered GNU GENERAL PUBLIC LICENSE |
@unnumbered GNU GENERAL PUBLIC LICENSE |
@center Version 2, June 1991 |
@center Version 2, June 1991 |
|
|
Line 492 library. If this is what you want to do
|
Line 496 library. If this is what you want to do
|
Public License instead of this License. |
Public License instead of this License. |
|
|
@iftex |
@iftex |
@node Preface, Goals, License, Top |
|
@comment node-name, next, previous, up |
|
@unnumbered Preface |
@unnumbered Preface |
@cindex Preface |
@cindex Preface |
This manual documents Gforth. The reader is expected to know |
This manual documents Gforth. The reader is expected to know |
Line 501 Forth. This manual is primarily a refere
|
Line 503 Forth. This manual is primarily a refere
|
for introductory material. |
for introductory material. |
@end iftex |
@end iftex |
|
|
@node Goals, Other Books, Preface, Top |
@node Goals, Other Books, License, Top |
@comment node-name, next, previous, up |
@comment node-name, next, previous, up |
@chapter Goals of Gforth |
@chapter Goals of Gforth |
@cindex Goals |
@cindex Goals |
Line 566 can also get it from Global Engineering
|
Line 568 can also get it from Global Engineering
|
for publication is available electronically and for free in some MS Word |
for publication is available electronically and for free in some MS Word |
format, and it has been converted to HTML. Some pointers to these |
format, and it has been converted to HTML. Some pointers to these |
versions can be found through |
versions can be found through |
@*@file{http://www.complang.tuwien.ac.at/projects/forth.html}. |
@*@url{http://www.complang.tuwien.ac.at/projects/forth.html}. |
|
|
@cindex introductory book |
@cindex introductory book |
@cindex book, introductory |
@cindex book, introductory |
Line 1371 The index of the innermost loop can be a
|
Line 1373 The index of the innermost loop can be a
|
of the next loop with @code{j}, and the index of the third loop with |
of the next loop with @code{j}, and the index of the third loop with |
@code{k}. |
@code{k}. |
|
|
|
doc-i |
|
doc-j |
|
doc-k |
|
|
The loop control data are kept on the return stack, so there are some |
The loop control data are kept on the return stack, so there are some |
restrictions on mixing return stack accesses and counted loop |
restrictions on mixing return stack accesses and counted loop |
words. E.g., if you put values on the return stack outside the loop, you |
words. E.g., if you put values on the return stack outside the loop, you |
Line 1607 implemented the ANS Forth locals wordset
|
Line 1613 implemented the ANS Forth locals wordset
|
The ideas in this section have also been published in the paper |
The ideas in this section have also been published in the paper |
@cite{Automatic Scoping of Local Variables} by M. Anton Ertl, presented |
@cite{Automatic Scoping of Local Variables} by M. Anton Ertl, presented |
at EuroForth '94; it is available at |
at EuroForth '94; it is available at |
@*@file{http://www.complang.tuwien.ac.at/papers/ertl94l.ps.gz}. |
@*@url{http://www.complang.tuwien.ac.at/papers/ertl94l.ps.gz}. |
|
|
@menu |
@menu |
* Gforth locals:: |
* Gforth locals:: |
Line 4576 cannot be represented correctly in the o
|
Line 4582 cannot be represented correctly in the o
|
these places in the dictionary and verify that these cells are dead |
these places in the dictionary and verify that these cells are dead |
(i.e., not read before they are written). |
(i.e., not read before they are written). |
|
|
|
@cindex @code{savesystem} during @file{gforth-makeimage} |
|
@cindex @code{bye} during @file{gforth-makeimage} |
|
@cindex doubly indirect threaded code |
|
@cindex environment variable @code{GFORTHD} |
|
@cindex @code{GFORTHD} environment variable |
|
@cindex @code{gforth-ditc} |
There are a few wrinkles: After processing the passed @var{options}, the |
There are a few wrinkles: After processing the passed @var{options}, the |
words @code{savesystem} and @code{bye} must be visible. A special doubly |
words @code{savesystem} and @code{bye} must be visible. A special doubly |
indirect threaded version of the @file{gforth} executable is used for |
indirect threaded version of the @file{gforth} executable is used for |
Line 4649 gforth -i @var{image}
|
Line 4661 gforth -i @var{image}
|
@cindex executable image file |
@cindex executable image file |
@cindex image files, executable |
@cindex image files, executable |
If your operating system supports starting scripts with a line of the |
If your operating system supports starting scripts with a line of the |
form @code{#! ...}, you can make your image file executable, and you'll |
form @code{#! ...}, you just have to type the image file name to start |
just have to type the image file name to start Gforth with this image |
Gforth with this image file (note that the file extension @code{.fi} is |
file (note that the file extension @code{.fi} is just a convention). |
just a convention). I.e., to run Gforth with the image file @var{image}, |
|
you can just type @var{image} instead of @code{gforth -i @var{image}}. |
|
|
I.e., in most Unix systems, you just have to make the image file |
doc-#! |
@var{image} executable with |
|
|
|
@example |
|
chmod +x @var{image} |
|
@end example |
|
|
|
and then you can invoke it by simply typing @var{image} instead of |
|
@code{gforth -i @var{image}}. |
|
|
|
@node Modifying the Startup Sequence, , Running Image Files, Image Files |
@node Modifying the Startup Sequence, , Running Image Files, Image Files |
@section Modifying the Startup Sequence |
@section Modifying the Startup Sequence |
Line 4693 You can make a turnkey image by letting
|
Line 4698 You can make a turnkey image by letting
|
(your turnkey application) that never returns; instead, it exits Gforth |
(your turnkey application) that never returns; instead, it exits Gforth |
via @code{bye} or @code{throw}. |
via @code{bye} or @code{throw}. |
|
|
|
@cindex command-line arguments, access |
|
@cindex arguments on the command line, access |
|
You can access the (image-specific) command-line arguments through the |
|
variables @code{argc} and @code{argv}. @code{arg} provides conventient |
|
access to @code{argv}. |
|
|
|
doc-argc |
|
doc-argv |
|
doc-arg |
|
|
|
If @code{'cold} exits normally, Gforth processes the command-line |
|
arguments as files to be loaded and strings to be evaluated. Therefore, |
|
@code{'cold} should remove the arguments it has used in this case. |
|
|
@c ****************************************************************** |
@c ****************************************************************** |
@node Engine, Bugs, Image Files, Top |
@node Engine, Bugs, Image Files, Top |
@chapter Engine |
@chapter Engine |
Line 4706 The ideas in this section have also been
|
Line 4725 The ideas in this section have also been
|
@cite{ANS fig/GNU/??? Forth} (in German) by Bernd Paysan, presented at |
@cite{ANS fig/GNU/??? Forth} (in German) by Bernd Paysan, presented at |
the Forth-Tagung '93 and @cite{A Portable Forth Engine} by M. Anton |
the Forth-Tagung '93 and @cite{A Portable Forth Engine} by M. Anton |
Ertl, presented at EuroForth '93; the latter is available at |
Ertl, presented at EuroForth '93; the latter is available at |
@*@file{http://www.complang.tuwien.ac.at/papers/ertl93.ps.Z}. |
@*@url{http://www.complang.tuwien.ac.at/papers/ertl93.ps.Z}. |
|
|
@menu |
@menu |
* Portability:: |
* Portability:: |
Line 5186 predictive value for the performance of
|
Line 5205 predictive value for the performance of
|
In @cite{Translating Forth to Efficient C} by M. Anton Ertl and Martin |
In @cite{Translating Forth to Efficient C} by M. Anton Ertl and Martin |
Maierhofer (presented at EuroForth '95), an indirect threaded version of |
Maierhofer (presented at EuroForth '95), an indirect threaded version of |
Gforth is compared with Win32Forth, NT Forth, PFE, and ThisForth; that |
Gforth is compared with Win32Forth, NT Forth, PFE, and ThisForth; that |
version of Gforth is 2\%@minus{}8\% slower on a 486 than the version |
version of Gforth is 2%@minus{}8% slower on a 486 than the direct |
used here. The paper available at |
threaded version used here. The paper available at |
@*@file{http://www.complang.tuwien.ac.at/papers/ertl&maierhofer95.ps.gz}; |
@*@url{http://www.complang.tuwien.ac.at/papers/ertl&maierhofer95.ps.gz}; |
it also contains numbers for some native code systems. You can find a |
it also contains numbers for some native code systems. You can find a |
newer version of these measurements at |
newer version of these measurements at |
@file{http://www.complang.tuwien.ac.at/forth/performance.html}. You can |
@url{http://www.complang.tuwien.ac.at/forth/performance.html}. You can |
find numbers for Gforth on various machines in @file{Benchres}. |
find numbers for Gforth on various machines in @file{Benchres}. |
|
|
@node Bugs, Origin, Engine, Top |
@node Bugs, Origin, Engine, Top |
Line 5201 find numbers for Gforth on various machi
|
Line 5220 find numbers for Gforth on various machi
|
Known bugs are described in the file BUGS in the Gforth distribution. |
Known bugs are described in the file BUGS in the Gforth distribution. |
|
|
If you find a bug, please send a bug report to |
If you find a bug, please send a bug report to |
@code{bug-gforth@@gnu.ai.mit.edu}. A bug report should |
@email{bug-gforth@@gnu.ai.mit.edu}. A bug report should |
describe the Gforth version used (it is announced at the start of an |
describe the Gforth version used (it is announced at the start of an |
interactive Gforth session), the machine and operating system (on Unix |
interactive Gforth session), the machine and operating system (on Unix |
systems you can use @code{uname -a} to produce this information), the |
systems you can use @code{uname -a} to produce this information), the |