Forth Dimensions/Volume 1/Number 1/Forth Learns German

Forth Dimensions, Volume 1, No. 1
by John S. James
Forth Learns German
2715297Forth Dimensions, Volume 1, No. 1 — Forth Learns GermanJohn S. James

Forth now understands German, thanks to the following redefinitions of the operations in the Decus (Caltech) Forth manual.

Many of the operations were mathematical symbols, and of course they did not have to be translated. Of the rest, the control operations (IF, THEN, ELSE, BEGIN, END, DO, LOOP, +LOOP) are special, because they are "immediate operations"; that is, they are executed at compile time. Just redefining their names would not work, because they would try to execute right in the definitions. So their original definitions were copied, but with the German names.

Program development time for bilingual capability, two hours. Memory required, 600 bytes. Effect on run-time execution speed, zero.

BLOCK 30
1 ( GERMAN. JJ, 6/19/78)
2 : ABWERFEN DROP ; : UBER OVER ;
3 : VERT SWAP ; : SPAREN SAVE ; : UNSPAREN UNSAVE ;
4 : UNBEDINGT ABS ; : UND AND ;
5 : HOCHST MAX ; : MINDEST MIN ; : REST MOD ;
6 : ODER OR ; : /REST /MOD ; : 0SETZEN 0SET ;
7 : 1SETZEN 1SET ; : HIER HERE ; VERGESSEN FORGET ;
8 : SCHLUSSEL CODE ; : BESTANDIG CONSTANT ;
9 : GANZE INTEGER ; : ORDNUNG ARRAY ; : IORDNUNG IARRAY ;
10 : SETZEN SET ;
11 : AUFS-LAUFENDE UPDATE ; : AUSRADIEREN ERASE-CORE ;
12 : LADEN LOAD ; : ZURUCK CR ;
13 : SCHREIBEN TYPE ; : BASIS BASE ;
14
15
16 ( THE SAME: DUP, MINUS, =L, BLOCK, ;S, F) ;S

The control operation definitions (OB, DANN, SONST, BEGINNEN, ENDEN, TUN, SCHLINGE, +SCHLINGE) are not shown here; they are all short (one line), and exact copies of the English operations. (Incidently this particular vocabulary is a rough draft; we have not seen the results of the International Forth Standards Team, which is currently at work.) The word GERMAN is defined on the load screen, so that the Forth user can call in the German vocabulary when desired. The following session shows the entry and execution of a fibonacci sequence program in German (until 16-bit overflow).

FORTH LOAD
OK
GERMAN
OK
: PRUFUNG 0 1 30 0 TUN VERT DUP . UBER + SCHLINGE ABWERFEN ABWERFEN ;
OK
PRUFUNG
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 -19168 9489 -9679 -190 -9869 -10059

On a (slightly) more speculative note, why not extend this scheme to a computer assisted international language for computer conferences, electronic mail, and international data-base utilities? Clearly natural language is too free, and computer languages like BNF are too restrictive, to be feasible. But a hybrid, a vocabulary of several hundred unambiguous words (each used in one sense only), and perhaps some computer-oriented syntactical markers, should be enough for useful dialog within a particular interest area. If it works for two languages it should work as well for any number. The final test—whether international teams could collaborate, after minimal training—would take a few weeks programming at most, after the vocabularies and terminal interfaces had been determined.