📜 ⬆️ ⬇️

Structured programming

In the early 80s of the XX century, in the depths of the problem laboratory of electronic computers of Moscow State University. MV Lomonosov began work on an unusual, by today's standards, language, or rather the system, or even say programming ideology.

PRSP


The result was PRSP, an interactive structured programming system.

DSSP was designed to reduce labor intensity, increase reliability and ensure wide availability of programming by systematically introducing the discipline of structured programming in conjunction with the interactive mode and the unconventional system architecture based on stacks, vocabulary and procedural code.

The basis of PRSP is a stacked processor emulated on computers with well-developed means of designing structured programs (PRSP processor).
')
The prototype of this processor was the Setun 70, an experimental ternary digital machine created in PNIL Moscow State University in the late 60s.

The interactive control of PRSP processor is implemented in an external (symbolic) language using a dictionary and compiler, following the pattern of the FORTH system, but with the possibility of compiling procedures in a downward sequence and removing unnecessary vocabulary entries.

RAYA


The basic language of PRSP - Developed Adaptive Language (PAR) is a low-level language in the sense that it represents objects typical of an assembly language (bits, bytes, machine words and elementary operations on them). Paradise differs from the traditional assembler language by postfix syntax, strict control discipline and the availability of effective means of replenishing and developing the language. Thus, PRSP is an alternative to assembler programming systems, which has several important advantages:

Examples


F1 - calculates 3 * X * X-4 * X + 2

: F1 [X] C [X,X] 3 * [X,3*X] 4 - [X,3*X-4] * [3*X*X-4*X] 2 + [3*X*X-4*X+2] ;

use F1
* 25 F1 . D 1777
* -9 F1 . D 281


F2 - calculates A2 * X * X-A1 * X + A0

: F2 [A0,A1,A2,X] C E4 E3 [A0,X,A1,X,A2] * + [A0,X,A2*X+A1] * + [A2*X*X-A1*X+A0] ;

using F2
* 1 2 3 4 F2 . D 57
* 1 2 -3 4 F2 . D -39


FG - factorial N, if N> 0, otherwise 0

: FG [N] C BR+ FCT T0 [N! 0] ;
[FCT - N]
: FCT [N] C 1- C DO PD [N!] ;
: P [F,K] E2 C2 [K,F,K] * E2 1- [F*K,K-1] ;


use FG
* -5 FG . D 0
* 5 FG . D 120


GCD - the greatest common divisor of the natural numbers M, N

: [N,M] RP D [] ;
[ - ]
: [,] E2 C2 / [,,] E2 D [,] C EX0 ;


use of gcd
* 48 72 . D 24
* 225 650 . D 25


DIALOG: question - answers - summary

B8
: [] - [] ;
: [] CR ." ?
1.
2.
3. " [] ;
: - [] RP AR [] ;
[AR - ]
: AR [] CR ." - " TIB BR #1 R1 #2 R2 #3 R3 ELSE R4 [] ;
: R1 [] CR ." " EX [] ;
: R2 [] CR ." " EX [] ;
: R3 [] CR ." !" EX [] ;
: R4 [] CR ." " [] ;
B10


use DIALOG
*
?
1.
2.
3.
- 7

- 3
!


Implementations



Instead of conclusion


Unfortunately, at the moment the development of the language has officially ceased, the latest news is dated 2002.

However, anyone can test their skills in structured programming:
  1. git clone git: //github.com/ingeniarius/DSSP-32.git
  2. follow the instructions from INSTALL

Collecting the system takes only a few minutes ... Enjoy!

Additional materials on PRSP



PS We will be glad to all those interested in the support and development of this unusual and interesting system.

Source: https://habr.com/ru/post/62589/


All Articles