The program I'm dealing with, BTW, is C.H. Lindsey's Algol 68S compiler from 1977-1983. The source code is extremely peculiar, with its own custom preprocessor and extensions, and also line numbers. It even comes with its own custom bytecode Pascal compiler. Here's an example.
00750 (*-03()
00760 (*+01() PROGRAM A68SCOM(SOURCDECS, OUTPUT+, LGO, LSTFILE, A68INIT ); ()+01*)
00770 (*-01() (*-05() (*+71()
00780 PROGRAM A68SCOM(SOURCDECS, LGO, LSTFILE, A68INIT, DUMPF, OUTPUT);
00790 ()+71*) ()-05*) ()-01*)
00800 (*+25() PROGRAM A68SCOM(SOURCDECS, OUTPUT, LGO, LSTFILE, A68INIT ); ()+25*)
00810 ()-03*)
It's tempting to try and refactor this into something modern, but I really don't think that's a good idea as this is a genuine historical artifact. I would like to try and build this in as original a format as possible. It will (mostly) compile with p2c but I'm very distrustful of a compiler which claims to prioritise readable output over correctness! It's structured as a set of bag-of-procedures files, which get separately compiled and then linked together, and it's this structure which I'm trying to replicate in FreePascal (in -Miso mode).
However, this may all be moot. Someone's just discovered that the way the compiler is built is that it loads a preinitialised memory image, which is generated by doing partial builds of the compiler, running the init code, and then dumping the heap to disk --- this works entirely because of the way it's compiled to individual object files. This of course won't work on any modern system. So we'll probably have to persuade the preprocessor to generate a single file containing both the compiler and all the init code, so eliminating the need for partial compilation.
Still, it'd be really nice if FreePascal could be persuaded to work in a mode more like traditional compilers. It'd make it so much easier to, e.g., integrate into third-party build systems.