![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Один крутой чувак сварганил фронтенд Алгола 68 к компилятору GCC. Заслал буквально вчера: gcc.gnu.org/pipermail/gcc-patches/2025-January/672384.html
"Hello people, happy GNU year!
This WIP is a GCC front-end for Algol 68, the fascinating, generally poorly understood and often vilified programming language. It is common knowledge that Algol 68 was well ahead of its time back when it was introduced, and anyone who knows the language well will suspect this probably still holds true today, but more than fifty years after the publication of the Revised Report the world may finally be ready for it, or perhaps not, we shall see ;) At the very least having support in GCC will make it easier for Algol 68 enthusiasts to write, share and use their programs in modern systems."
Исходники здесь: forge.sourceware.org/jemarch/a68-gcc/src/branch/a68
Пример программы на Алголе 68:
"Hello people, happy GNU year!
This WIP is a GCC front-end for Algol 68, the fascinating, generally poorly understood and often vilified programming language. It is common knowledge that Algol 68 was well ahead of its time back when it was introduced, and anyone who knows the language well will suspect this probably still holds true today, but more than fifty years after the publication of the Revised Report the world may finally be ready for it, or perhaps not, we shall see ;) At the very least having support in GCC will make it easier for Algol 68 enthusiasts to write, share and use their programs in modern systems."
Исходники здесь: forge.sourceware.org/jemarch/a68-gcc/src/branch/a68
Пример программы на Алголе 68:
# Translation decimal number to Roman notation and vice versa # PROGRAM BEGIN PROC roman = (INT number) STRING: BEGIN INT n := number, STRING result; []STRUCT(INT value, STRING r) table = ((1000, "M"), (900, "CM"), (500, "D"), (400, "DC"), (100, "C"), (90, "XC"), (50, "L"), (40, "XL"), (10, "X"), (9, "IX"), (5, "V"), (4, "IV"), (1, "I")); FOR i TO UPB table DO INT v = value OF table[i], STRING r = r OF table[i]; WHILE v LE n DO (result +:= r, n -:= v) OD OD; result END; PROC value of roman = (STRING text) INT: IF text = "" THEN 0 ELSE OP ABS = (CHAR s) INT: CASE INT p; char in string (s, p, "IVXLCDM"); p IN 1, 5, 10, 50, 100, 500, 1000 ESAC, PROC char in string = (CHAR c, REF INT i, STRING s) BOOL: (FOR k TO UPB s DO (c = s[k] | i := k; l) OD; FALSE EXIT l: TRUE); INT v, maxv := 0, maxp; FOR p TO UPB text DO IF (v := ABS text[p]) > maxv THEN maxp := p; maxv := v FI OD; maxv - value of roman (text[: maxp-1])+ value of roman (text[maxp + 1:]) FI; ASSERT (roman (1968) = "MCMLXVIII"); ASSERT (value of roman ("MCMLXXIII") = 1973); 0 END FINISH
no subject
Date: 2025-01-03 02:12 (UTC)And it is really great. At times I feel that maybe, maybe we should try it IRL.
Need libraries, though. Maybe the "book" approach of A68 does not match modern realities.
no subject
Date: 2025-01-03 02:27 (UTC)no subject
Date: 2025-01-03 02:39 (UTC)no subject
Date: 2025-01-03 02:46 (UTC)no subject
Date: 2025-01-03 02:49 (UTC)no subject
Date: 2025-01-03 03:05 (UTC)no subject
Date: 2025-01-03 05:52 (UTC)no subject
Date: 2025-01-03 05:30 (UTC)я на А68 ЛГУ вырос, можно сказать.
no subject
Date: 2025-01-03 05:50 (UTC)no subject
Date: 2025-01-03 06:29 (UTC)кстати расчеты на нем шли на ура, народ быстренько запилил комплексный тип - и это зарешало. произвольные вырезки из массивов тоже были вне конкуренции.
no subject
Date: 2025-01-04 09:06 (UTC)no subject
Date: 2025-01-04 14:50 (UTC)Мое знакомство состоялось в 83м году на втором курсе - аргумент был "в отличие от Фортрана, можно писать несколько операторов в строке :)".
Преподаватели занимались расчетами для диссертаций и хоздоговоров, А68 вполне подходил.
no subject
Date: 2025-01-05 06:54 (UTC)no subject
Date: 2025-01-03 08:27 (UTC)