Concatenative topics
Concatenative meta
Other languages
Meta
Dialog System for Structured Programming (DSSP) was a programming language developed in the 1980s at Moscow State University. Its development was lead by Dr. Brusentsov who acted as theorist and project lead. It based its implementation on the short-lived Setun-70, a ternary stack-based computer system. It took many of its ideas from the Forth programming language while evolving into its own unique language.
One goal of DSSP was "one word of text - one word of machine code". Therefore to reach this goal, DSSP often introduced additional control structures. One such example is in flow control. Forth only described a IF ... ELSE ... THEN
operator, whereas the DSSP included several branch operators:
DSSP Forth [n] IF+ A [n] 0> IF A THEN [n] IF0 A [n] 0= IF A THEN [n] IF- A [n] 0< IF A THEN [n] BR+ A B [n] 0> IF A ELSE B THEN [n] BR- A B [n] 0< NEG IF A ELSE B THEN [n] BR0 A B [n] 0= IF A ELSE B THEN [n] BRS X Y Z [n] BR c1 p1 c2 p2 ... cN pN else pN+1
BRS
is a ternary branch operator that stands for BRanch on Sign. BR
is the DSSP equivalent to a switch statement. The following provides an example of BR
being used to implement a transcription function for the letters [A-Z]:
: TRANSCRIPTION [n] BR #A ."ei" #B ."bi" #C ."ci" .... #Z ."zet" ELSE ."???" ;
Further details on the differences between DSSP and Forth can be found in DSSP and Forth. Compare Analysis (Archive 1) (Archive 2). Finally, an example of DSSP's syntax can be seen in the following factorial implementation:
[FG - факториал N, если N>0, иначе 0] : FG [N] C BR+ FCT T0 [N! или 0] ; [FCT - факториал N] : FCT [N] C 1- C DO P D [N!] ; : P [F,K] E2 C2 [K,F,K] * E2 1- [F*K,K-1] ;
Many of the sources around DSSP are written in Russian. However, there are a handful of English sources. These English sources around the DSSP and Setun-70 were used to write this article.
Information about the Setun and the Setun-70:
Finally, there exists an open source, though incomplete, implementation of DSSP called LibreDSSP.
This revision created on Sat, 6 May 2023 10:18:56 by gifti (typos)