Marcel van der VeerAlgol 68EssaysTech TipsAll posts

Algol 68 Genie code browser

Below is a list with example Algol 68 programs, together with the cross-referenced source files of the current Algol 68 Genie version.

You can download the current version and its documentation here.

Example Algol 68 programs

File Synopsis Lines
       
ackermann.a68 Ackermann function, a paradigm total computable function that is not primitive recursive. 47
all-parser.a68 Non-left-recursive context-free grammar parser. 59
arithmetic-derivative.a68 Lagarias arithmetic derivate. 42
backtracking.a68 Split an amount of money in coins, by backtracking. 30
bulls-and-cows.a68 Break a unique code of `n' pegs and `m' colours you think of. 72
decision-tree.a68 Paradigm for building decision trees in Algol 68. 67
dictionary.a68 Write Python-style dictionaries in json format. 61
fibonacci-grammar.a68 Illustration of the use of procedure closures. 38
formula-manipulation.a68 Symbolic computing in Algol 68. 277
10  gnome-sort.a68 How a garden gnome sorts a line of flower pots. 74
11  hamming.a68 Compute regular (or Hamming) numbers. 64
12  hilbert-curve-latex.a68 Generate LaTeX code to plot a Hilbert curve. 106
13  hilbert-matrix.a68 Compute the determinant of a Hilbert matrix using fractions. 195
14  linear-regression.a68 Ordinary Least Squares, Principal Component and Partial Least Squares regression. 149
15  lisp-interpreter.a68 Miniature LISP interpreter in Algol 68. 167
16  longest-common-sequence.a68 Compute longest common subsequence of strings. 33
17  lucas-sequence.a68 Lucas sequence and the golden ratio. 36
18  mandelbrot-plotutils.a68 Plot a part of the Mandelbrot set. 56
19  parallel-fft.a68 Parallel Fast Fourier Transform in recursive form. 35
20  partial-parametrisation.a68 Lindsey's currying proposal for Algol 68. 31
21  pebbles.a68 Edsger Dijkstra's pebble problem. 69
22  queens.a68 'N' queens in classic backtracker. 41
23  quicksort.a68 The well-known recursive quicksort algorithm. 32
24  roman-decimal.a68 Translation between decimal and Roman notation. 60
25  triple-ref-trick.a68 The "Algol 68 triple-REF trick" implementation of quicksort. 36
26  tukey-test-tables.a68 Compute Studentized range q table. 57
27  van-wijngaarden-switch.a68 Van Wijngaarden's pseudo-switch. 37
28  warshall.a68 Warshall's algorithm for transitive closures. 64
29  wca.a68 Compute equilibrium Lennard Jones thermodynamic data. 141
30  www.a68 Reading web pages using Algol 68. 18
31  zeroin.a68 Zeroin is a classic root-finding algorithm. 137

Algol 68 Genie source files

File Synopsis Lines
a68g-apropos.c Command line help. 167
a68g-bits.c Miscellaneous routines. 554
a68g.c Algol 68 Genie main driver. 720
a68g-conversion.c Conversion tables for IEEE platforms. 84
a68g-diagnostics.c Error and warning routines. 872
a68g-io.c Low-level input-output routines. 288
a68g-keywords.c Algol 68 keyword tables. 214
a68g-listing.c Old-school listing file. 714
a68g-mem.c Low-level memory management. 315
10  a68g-non-terminal.c Non-terminal tables. 417
11  a68g-options.c Algol 68 Genie options. 1248
12  a68g-path.c Low-level file path routines. 185
13  a68g-postulates.c Postulates needed for proving equivalence of modes. 92
14  a68g-pretty.c Lay-out formatter for Algol 68. 1341
15  double.c LONG INT, LONG REAL and LONG BITS routines. 2109
16  double-gamic.c LONG REAL generalised incomplete gamma function. 416
17  double-math.c LONG REAL, LONG COMPLEX routines. 358
18  genie-assign.c Interpreter routines for assignations. 152
19  genie.c Interpreter driver. 879
20  genie-call.c Interpreter routines for procedure calls. 278
21  genie-coerce.c Interpreter mode coercion routines. 492
22  genie-declaration.c Interpreter routines for declarations. 215
23  genie-denotation.c Interpreter routines for denotations. 280
24  genie-enclosed.c Interpreter routines for enclosed clauses. 912
25  genie-formula.c Interpreter routines for formulas. 185
26  genie-hip.c Interpreter routines for jumps and SKIP. 223
27  genie-identifier.c Interpreter routines for identifiers. 91
28  genie-misc.c Miscellaneous interpreter routines. 113
29  genie-regex.c Low-level regular expression routines. 288
30  genie-rows.c Interpreter routines for ROW values. 139
31  genie-stowed.c Interpreter routines for STOWED values. 420
32  genie-unix.c Low-level UNIX routines. 874
33  moids-diagnostics.c MOID diagnostics routines. 182
34  moids-misc.c Miscellaneous MOID routines. 1196
35  moids-size.c Memory footprint (size) of a mode. 272
36  moids-to-string.c Pretty-print a MOID. 301
37  mp-bits.c [LONG] LONG BITS routines, legacy MP implementation. 653
38  mp.c [LONG] LONG INT, REAL routines. 1358
39  mp-complex.c [LONG] LONG COMPLEX math functions. 528
40  mp-gamic.c [LONG] LONG REAL generalised incomplete gamma function. 829
41  mp-gamma.c [LONG] LONG REAL error, gamma and beta functions. 500
42  mp-genie.c Multi-precision interpreter routines. 1443
43  mp-math.c [LONG] LONG REAL math functions. 1384
44  mp-mpfr.c [LONG] LONG REAL routines using GNU MPFR. 526
45  mp-pi.c [LONG] LONG REAL value of pi by AGM. 153
46  parser-annotate.c Annotate syntax tree. 122
47  parser-bottom-up.c Hand-coded bottom-up parser for Algol 68. 2034
48  parser-brackets.c Recursive-descent parenthesis checker. 231
49  parser.c Mailloux-type Algol 68 parser driver. 1088
50  parser-extract.c Extract tags from phrases. 547
51  parser-modes.c Mode table management. 1058
52  parser-moids-check.c Mode checker routines. 1748
53  parser-moids-coerce.c Mode coercion driver. 864
54  parser-moids-equivalence.c Prove equivalence of modes. 159
55  parser-refinement.c Refinement preprocessor. 238
56  parser-scanner.c Context-dependent Algol 68 tokeniser. 1605
57  parser-scope.c Static scope checker. 896
58  parser-taxes.c Symbol table management. 1430
59  parser-top-down.c Top-down parser for control structure. 610
60  parser-victal.c Syntax check for formal, actual and virtual declarers. 312
61  plugin-basic.c Plugin compiler routines. 388
62  plugin.c Plugin compiler driver. 972
63  plugin-driver.c Plugin compiler driver. 196
64  plugin-folder.c Plugin compiler constant folder. 453
65  plugin-gen.c Plugin compiler generator routines. 1806
66  plugin-inline.c Plugin compiler inlining routines. 1178
67  plugin-script.c Plugin script builder routines. 160
68  plugin-tables.c Plugin compiler tables. 536
69  prelude-bits.c Multiple precision BITS. 97
70  prelude.c Standard prelude definitions. 2321
71  prelude-gsl.c Standard prelude definitions from GSL. 662
72  prelude-mathlib.c Standard prelude definitions from GNU R math library. 137
73  rts-bool.c BOOL routines. 56
74  rts-char.c CHAR, STRING and BYTES routines. 729
75  rts-curl.c HTTP/HTTPS client. 152
76  rts-curses.c Curses interface. 228
77  rts-enquiries.c Environment enquiries. 77
78  rts-formatted.c Formatted transput. 2553
79  rts-heap.c Generator and garbage collector routines. 822
80  rts-int128.c 128-bit INT support. 282
81  rts-internal.c Transput routines. 360
82  rts-mach.c Machine parameters. 260
83  rts-monitor.c GDB-style monitor for the interpreter. 2290
84  rts-parallel.c Parallel clause implementation. 514
85  rts-plotutils.c Gnuplot's libplot interface. 1554
86  rts-postgresql.c PostgreSQL libpq interface. 817
87  rts-sounds.c SOUND routines. 603
88  rts-stowed.c Interpreter routines for STOWED values. 788
89  rts-transput.c Transput routines. 1769
90  rts-unformatted.c Unformatted transput. 2414
91  single-blas.c REAL GSL BLAS support. 60
92  single.c INT, REAL, COMPLEX and BITS routines. 1667
93  single-decomposition.c REAL GSL LU, QR and Choleski decomposition. 280
94  single-fft.c REAL, COMPLEX GSL fast fourier transform. 290
95  single-gamic.c REAL generalised incomplete gamma function. 414
96  single-gsl.c REAL GSL routines. 844
97  single-laplace.c REAL GSL laplace routines. 115
98  single-math.c REAL math routines supplementing libc. 776
99  single-multivariate.c REAL multivariate regression. 689
100  single-physics.c REAL GSL physical constants. 246
101  single-python.c REAL vector and matrix routines, Python look-a-likes. 312
102  single-r-math.c REAL GNU R math routines. 547
103  single-rnd.c REAL pseudo-random number generator. 194
104  single-svd.c REAL GSL matrix SVD decomposition. 106
105  single-torrix.c REAL vector and matrix support. 259
106  single-torrix-gsl.c REAL GSL vector and matrix routines. 1298

Algol 68 Genie include files

File Synopsis Lines
a68g-common.h Common definitions. 343
a68g-config.win32.h Default WIN32 configuration file. 128
a68g-config.win64.h Default WIN64 configuration file. 128
a68g-defines.h General macro definitions. 709
a68g-diagnostics.h Macros and text strings for diagnostics. 257
a68g-double.h LONG REAL definitions. 465
a68g-enums.h Enumerated constants. 265
a68g-environ.h Standard prelude and postlude. 63
a68g-frames.h Macros for opening/closing frames. 217
10  a68g-generic.h Platform dependent definitions. 55
11  a68g-genie.h Interpreter related definitions. 483
12  a68g.h Master include file. 160
13  a68g-includes.h Common a68g includes. 294
14  a68g-level-3.h Platform dependent definitions. 79
15  a68g-lib.h Internal math routines. 129
16  a68g-listing.h Definitions for making listing files. 38
17  a68g-mach.h Machine parameters. 69
18  a68g-masks.h Bit masks. 77
19  a68g-math.h Internal math tables. 441
20  a68g-moids.h Definitions related to MOIDS. 104
21  a68g-mp.h Definitions for multiple precision modes. 580
22  a68g-nil.h Various forms of NIL. 66
23  a68g-numbers.h Math constants. 45
24  a68g-optimiser.h Definitions for the plugin compiler. 119
25  a68g-options.h Definitions for option processing. 39
26  a68g-parser.h Definitions related to the parser. 175
27  a68g-physics.h Various numerical constants from GSL. 240
28  a68g-platform.h Platform dependent definitions. 160
29  a68g-plugin.h Definitions for the plugin compiler. 207
30  a68g-postulates.h Definitions related to postulates. 35
31  a68g-prelude-gsl.h GSL definitions. 541
32  a68g-prelude.h RTS related definitions. 763
33  a68g-prelude-mathlib.h R standalone mathematics library definitions. 138
34  a68g-stack.h Macros for stack checking. 54
35  a68g-stddef.h Various standard definitions. 94
36  a68g-torrix.h REAL vector and matrix support. 84
37  a68g-transput.h Transput related definitions. 86
38  a68g-types.h Internal type definitions. 595

The number of source lines in this version is 79698.


© 2001-2026 J.M. van der Veer
jmvdveer@algol68genie.nl