The first reaction of many people with whom I had to talk about Fort: "This is probably a kind of Fortran?". Unfortunately, the level of awareness of the computer-computer community about this completely different programming language is quite low. In this article we will try to figure out what the Fort is, and why this programming language is not used everywhere.Dip in the history of the Fort (Forth). In the early 1970s, Charles Moore began developing software for the microcomputer that controls the radio telescope. Since programming in Assembler led to the uncontrollability of developing a fairly complex program, and for the microcomputer being used there was no high-level language due to hardware limitations, Charles Moore set about creating a compact and powerful programming language that allowed him to solve his tasks brilliantly. The success of the new programming language was determined by the fact that a fast and functional program was created on the limited resources of the device, which made it possible to do much more than originally planned in the technical task.
The fort (from forward. Forward, resulting from the need to shorten the word fourth - the fourth, to five letters due to operating system limitations on the length of the file name) in 1976 became the standard programming language for the American astronomical society. Due to the high degree of portability and compactness, as well as speed, the Fort was actively used in a variety of microcontroller-controlled devices (spectrograph on the Shuttle, micromodules for controlling artificial satellites of the Earth, for computer control systems at the Riyadh airport, computer vision systems, and cardiological control, pocket translators). The fort acts as the progenitor of such a well-known print management language as PostScript.
')
In its structure, the Fort is a collection of primitives - words that participate in the definition of other words. An important feature of the Fort is the use of a stack for transferring parameters between words; such a design makes it very flexible and simple to implement complex concepts. Word sets related to a specific area can be allocated to dictionaries. The hierarchical structure of dictionaries makes it possible to naturally organize the inheritance of words from a parent dictionary. The basic dictionary of the fort is less than four dozen words, and it already allows you to get full-fledged programs by expanding the source dictionary.
The fort itself is a metasystem - it combines the functions of the compiler and interpreter, the Fort can be used without support from the operating system and used to compile itself, including on other platforms.
Unlike most programming languages, which have a rigid structure that does not allow changing the syntax and many basic elements of the language, nothing prevents you from writing a system modification on Forte that understands the syntax of the subject area for which the program is written. A prime example is the writing of a Fort assembler for a particular processor, performed in one working day by a qualified forter. Moreover, such an assembler supports structured programming and transparent insertion into the assembly code of words from the Fort dictionary itself. Object-oriented programming is supported in the same way.
The theme of creating Fort-processors, whose command system is a machine representation of the most frequently used primitive words, is still popular. Thanks to the minimalism of the base Fort system, this is easily realizable, especially since the programmable arrays of logic elements have now reached such dimensions that the Fort processor integrates into the remaining 10% of the gates after programming the main logic as a bonus. This is something from the category of this: "And in the corner of our small and cozy children's room, an imperiously located aquarium with a hippopotamus."
The ease of writing Fort Systems led to a huge variety of existing implementations - only the lazy Forter did not write his Fort. A large number of systems are poorly compatible, since there are three Fort standards: Fort-79, Fort-83, and ANSI-Fort-94. Standards, although they describe the necessary minimum of words for implementation, but give a huge scope for independent changes, which is happening everywhere. There are implementations of the Fort written in Assembler, C, Python, Pascal, Java, as well as created with the help of target compilers for other Fort systems.
I would not like to joyfully declare that the Fort lives a full-fledged life of a programming language, but this is not quite so. The fort firmly occupied a niche as a programming language for microcontrollers, for which it is necessary to organize a rather complicated scheme of functioning with a minimum of resources. However, there are few examples of writing in modern conditions of large programs, since the speed of development on RAD systems exceeds the capabilities of Fort systems.
Thus, in terms of frequency of use, the Fort high-level programming language is even below Assembly level. When solving problems that require writing an assembler code, the Fort has many advantages: compact code, a structural assembler, which makes it easy to embed high-level definitions in the body of assembler words. For those who want to learn and use Assembler, I would recommend starting with learning Fort, as I did in my time. The result of this method of training will be much more rapid and high-quality mastering of the Assembler, especially since after learning the basics you will definitely want to make your Fort system (no matter how you say, practice is a forge skill).
For me, the Fort gave a lot - after mastering the language, I began to notice that the code in Delphi became shorter and more understandable, there was a habit of documenting the main methods and fields of objects (since it is very desirable to describe stack diagrams for each word in Forte).
Thanks to the study of the book “Design and software implementation of expert systems on personal computers” by Tausenda and Focht, I gained a lot of information about the internal logic of the work of such languages ​​as Lisp and Prolog. The Kelly and Spice book "FORT Programming Language" led me to a clear understanding of how to write your own programming language and what is Fort-assembler. To improve the programming style, the book “Way of Thinking - Fort” by Leo Brody turned out to be absolutely invaluable in influencing me.
A fort can give a programmer a lot of useful information, even if it will continue to program in another language. The fort gives the notion of programming discipline, which is necessary for the creation of a working and easily followed program. A bad programmer fort does not forgive mistakes, but encourages a good one to become great.
Dmitry SpitsynUseful links on the topic