The forth language

the First reaction of many with whom I had to say about the Forte: "This is probably the kind of Fortran?". Unfortunately, the awareness of computer related community about this completely different from the rest of a programming language is low. In this article we will try to deal with what is a Fort, and why this programming language is not used throughout.

Delve into the history of the Fort (Forth). In the early 1970s, Charles Moore has been developing software for microcomputers is used to operate the radio telescope. Because Assembler programming led to the uncontrollability of the development of quite complex programs, and used computer due to hardware restrictions it was not high-level language, Charles Moore have started to create compact and powerful programming language, allowing to successfully solve the tasks set before him. The success of the new programming language was determined by the fact that on limited resources devices were designed fast and functional program, allowing you to do much more than originally planned in the technical specification.


Fort (from the English. forth — forward, resulting from the need to reduce the fourth word — fourth, to five letters because of OS limitations on file name length) in 1976, has become the standard language for programming for the American astronomical society. Due to the high degree of portability and compactness, and performance, the Fort to the 1990s had been widely used in a variety of devices with microcontroller control (spectrograph on the Shuttle, micromodules control artificial satellites, for the control system at the airport in Riyadh, computer vision systems, automation of blood and cardiac monitoring, pocket translators). The Fort stands the progenitor of this well-known control language print as PostScript.

The structure of the Fort is a set of primitive words which are involved in the definition of other words. An important feature of forth using the stack to pass parameters between words, this design allows a very flexible and simple to implement difficult concepts. The sets of words belonging to a particular region, can stand out in the dictionary. The hierarchical structure of dictionaries allows of course to organize the inheritance of words from the dictionary-parent. The basic vocabulary of the Fort is less than four dozen words, and it allows you to fully program an extension of the original dictionary.

Fort himself is the meta — it combines the functions of compiler and interpreter, Fort can be used without support from the operating system and used to compile yourself, including on other platforms.

Unlike most programming languages that have a rigid structure that does not allow you to change the syntax and many basic elements of the language, nothing prevents on the Fort to write a modification of the system, understanding the syntax of the subject area for which the program is written. A striking example is writing a forth assembler for the specific processor to be performed in one working day by a qualified forter. Moreover, the assembler supports structured programming and a transparent insert in Assembly code words from the dictionary of the Fort. In the same way, you add support for object-oriented programming.

Still a popular topic of creating a Fort-processor, the command system which is a machine representation of the most frequently used words primitive. Thanks to the minimalism of the underlying forth system is easily possible, moreover, the programmable matrix of logic elements has now reached such proportions that the Fort-processor is integrated on the remaining after programming the core logic 10% of the valves as a bonus. It's something from the category of this: "And in the corner of our small and cozy children's room quietly located aquarium with a hippopotamus".
The ease of writing Fort systems has led to a huge variety of existing implementations — wrote your Fort just lazy forter. A large number of systems are not well compatible, because there are three standard Fort: Fort 79, Fort-83 and ANSI-Fort-94. Standards, though, and describe the necessary minimum of words to implement, but give a huge scope for self-change that is universally the case. There are implementations of the Fort written in Assembly, C, Python, Pascal, Java, and also created with target compilers other Fort systems.

But I would like happily to announce that Fort lives life to the full programming language, but it is not so. The Fort occupied a lucrative niche as the programming language of microcontrollers, for which it is necessary to arrange a rather complicated scheme of functioning with minimum resources. However, examples of writing in modern conditions large programs are few, since the speed of development on systems RAD exceeds the capabilities of Fort systems.

Thus, the frequency of use, high-level programming language, the Fort is even below the level of Assembler. When solving problems that require writing Assembly code Fort has many advantages: compactness of code, structural assembler, allowing you to easily introduce into the body assembler of words, a high-level definition. For those who want to learn and use Assembler, I would recommend to begin with a study of the Fort, as I once did. The result of this method of learning will be much faster and better development of Assembler, especially after learning the basics you will want to make their Fort system (as you may say, practice — smithy skills).

For me, the Fort gave many after learning the language, I began to notice that the code in Delphi became shorter and clear, had the habit to document the main methods and fields of objects (because in the Forte is very desirable to describe the stack diagram for each word).

Through a study of the book "Design and software implementation of expert systems on personal computers" by Townsend and Fochta, I learned a lot of information about the inner logic of such languages as Lisp and Prolog. The book is Kelly and Spice "the forth Language" led me to a clear understanding of how to write your own programming language and what is the forth assembler. To improve programming style proved to be an invaluable influence on my book Leo Brody "Way of thinking — Fort".

Fort can give the programmer a lot of useful, even if it is to continue to program in another language. The Fort gives the notion of a discipline of programming, which is necessary to create a working and easily maintainable programs. Bad programmer Fort is not forgiving, and good stimulates to be great.

Dmitry Spitsyn
the

Useful links


the
Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

A Bunch Of MODx Revolution + LiveStreet

Monitoring PostgreSQL with Zabbix

PostgreSQL load testing using JMeter, Yandex.Tank and Overload