Going Forth to Erlang by Manoj Govindan at

Описание к видео Going Forth to Erlang by Manoj Govindan at

Forth is a classic imperative stack-based programming language that fills a very specific niche. Erlang is a concurrent, functional, fault-tolerant programming language that occupies another, albeit wider, niche. There is very little in common between the two except for a shared respect for Alan Turing. This session is a case study that narrates the story of building a bridge between the two languages. The bridge allows for Forth nodes to run in a Erlang controlled world, with the ability to talk to Erlang nodes, send messages, invoke processes and so on.

In particular we'll discuss the various threading techniques used in Forth, listed below. We'll discuss how the choice of threading model impacts the design of the Erlang-Forth bridge.

Indirect Threaded Code (ITC)

A classical Forth threading technique. All the other threading schemes are considered "improvements" on this. Consider the following Forth expression:

: SQUARE DUP * ;
In a typical ITC Forth this would appear in memory as shown in the image below:

Figure 1 (Refer image here: https://confengine.com/functional-con...)

Direct Threaded Code (DTC)

This model is different from ITC in one respect: the Code Field contains actual machine code, rather than the address of some machine code.

Subroutine Threaded Code (STC)

This model relies on the following fact: a high-level Forth definition is nothing but a list of subroutines to be executed.

Token Threaded Code (TTC)

This model optimizes for size, at the cost of speed. A token-threaded Forth keeps a table of addresses of all Forth words. The token value is then used to index into this table, to find the Forth word corresponding to a given token.

Details: https://confengine.com/functional-con...

Conference: https://functionalconf.com

Комментарии

Информация по комментариям в разработке