Sign up
Forgot password?
FAQ: Login

Scanlon Leo J. Forth Programming

  • djvu file
  • size 61,68 MB
  • added by
  • info modified
Scanlon Leo J. Forth Programming
Howard W Sams, 1983. — 246 p. — ISBN: 0-672-22007-5.
Ever since the advent of FORTRAN in the 1950s, so many high-level languages have been introduced that few people can keep track of them. Some of these languages generated initial excitement, then slowly faded from the scene. Other languages were well conceived, but were so difficult to use that they, too, disappeared. Still other languages attracted a dedicated group of advocates, but were too specialized to gain general acceptance. However, every so often a new language has features which so appeal to the programming public that the language
is accepted. FORTH* is such a language.
The most attractive feature of FORTH is that it can be extended. That is, if you need to perform some function that is not already included in the language, you can add it! FORTH consists of a set of predefined commands, called words. Each word performs one specific task, such as adding two numbers or storing a number in memory. If you wish to perform more than one of these functions, you can do so by having the computer execute the appropriate sequence of words. For example, to add two numbers and store the sum in memory, you would
execute the " add " word, then the "store" word.
If your application calls for many " add - t hen - store " sequences, you can define this two-word sequence as a new, single word, and add it to FORTH's word set, its dictionary. Thereafter, any time you need to do an add-then-store, you simply use the new word from the dictionary. In this way, FORTH programming involves defining word after word, with each new word at a higher level than the words used to construct it.
This building-block approach offers several advantages. First, since new words are always constructed from previously defined, error-free, older words, FORTH programs (that is, words; they are equivalent) are inherently easy to debug. In •FORTH is a trademark of FORTH, Inc., 2309 Pacific Coast Highway, Hermosa Beach, CA 90254.most cases, debugging a new word is simply a matter of determining whether the word operates as expected, not whether its construction is valid. Most word definitions are short, too,since you are building w i t h lower-level words, which also
makes troubleshooting easier.
Moreover, the modularity of FORTH words allows them to be used in a variety of programs. This means that you only need to program a given function once. Thereafter, it becomes part of apermanent " toolbox " in your system.
Ease of programming and debugging ensures that even novice FORTH programmers can develop software quickly and efficiently. Besides this cost-effectivity, system developers are also impressed with the compactness of FORTH-based software in memory and the fact that programs execute faster than with most other high-level languages — often at speeds approaching that of assembly language!
This book describes FORTH "from the ground up." It starts with the most fundamental concepts and gradually introduces more complex topics, thereby helping you learn the language in an orderly manner. If you have already done some FORTH programming, using any of the standard software packages, this book will clarify many points that may not be fully explained (or perhaps not even mentioned) in the manufacturer's
documentation.
  • Sign up or login using form at top of the page to download this file.
  • Sign up
Up