Oh, obviously this will be better than thought. The compile.c should (later) also been able to handle 68K code. I think ~80-90% of the IMP80 sources (and maybe ~70-80 % of all imp sources) are for the APM/Fred.
I still wonder what the goal is. Will it also read the 68k MOB binaries and display everything? Then it’s not just a compiler but rather an emulator.
Wouldn’t it be better/easier to make an 68k compiler?
Some system files and libraries I think are missing or at least not public to the archives. But maybe they have them as well.
I’m not entirely sure what you are aiming for as you’ve mentioned half a dozen systems in various posts, but let me try to paint a wider picture and see if maybe it clarifies anything for you.
Our archives were a case of ‘grab everything while we still can’ and are admittedly hard to find your way around. Most everything we have is there - the only things removed were anything that was obviously personal data or in one case, everything in that person’s Emas directory until we had time to sort through it, because his research had allowed him access to many copyrighted texts for stylistic analysis, which we don’t have permission to publish. Because of a somewhat awkward (not antagonistic, just difficult due to security issues and DPR interpretations) relationship with the University, we lost the ability to update the archive a few years back, so anything acquired since then is on my net server ( https://gtoal.com/history.dcs.ed.ac.uk/archive/ ) or on my home computer, pending being sorted out and uploaded. Most of the later items are published papers rather than source code.
The archive contains files for the old ICL 4/75 EMAS, the 2900 series Emas versions, and even a few for the later IBM version. It has sources - some machine readable, some scans of listings - for older systems invented at Edinburgh such as the PDP15 O/S, Legos, Isys, the original Filestore, etc. We have sources for the pdp-11 system Deimos, the 68K APM (aka Fred Machine, named after the designer Fred King) and a few files from the department’s Vax/VMS - but most of the VMS archive is on a CD at Edinburgh that hasn’t been shared with us. We have compiler sources that - if compiled into modern binaries - would allow us to cross-compile files for any of these old systems that we still have sources from. This is where the compilers come in…
Back in the early 2000’s my classmate Andy Davis resurrected an Imp77 compiler but it was a 16-bit only version, and it sort of went ‘stiff’. This year, John McMullen resurrected Andy’s compiler and this time upgraded it to a 32-bit version - except it was 32-bit only, it didn’t have support for 16-bit data. Turns out many of the archive sources require both 16 and 32 bit support (not to mention being byte-sex dependent in several cases.) And there have been so many dialects of Imp (every compiler writer seems to have felt compelled to add their own tweaks so there are as many dialects as there are compilers) - that it is a major job getting any arbitrary program to compile under the current 32 bit Imp77. So my justification for creating yet another Imp compiler - this time an Imp to C transpiler - was that it would support all the various dialects! Most could be turned on by default as they did not cause incompatibilities, though a few would have to be handled by command line options when the behaviour of two dialects were mutually incompatible. The potential mess of many sets of options, however, could be avoided by this strategy: once the transpiler was working, it would run the original front-ends of all the old compilers before attempting to translate any program into C - using the old compilers as a syntax checker effectively - so that the relevant translation options could be determined by observing which of the ancient compilers managed to syntax-check the user’s program successfully! Sounds crazy but it is looking like it will work, I have a few of the old front-ends working now, plus the old syntax checkers themselves which were Imp front-ends without a code generator, built for speed (and for checking sources from within your editor without exiting to compile properly). By the way modern systems are so fast that using these old compilers as a syntax check is so quick it isn’t even noticable!
So this new Imp to C that I first mentioned in an earlier post is almost working, but not quite ready for release as there are a few small issues in the generated C that are still being fixed by a manual edit. But with that caveat you can have a look at some programs that have already been translated to get an idea of where it is going, in: Index of /compilers101/new-imp-to-c/examples I don’t believe there are any remaining Imp constructs that I haven’t worked out a way to represent in GCC’s extended version of C. I think GCC has finally caught up with Algol-family compilers of the 70’s and 80’s
That all said - you may ask why the interest in compilers rather than emulators - well, the short answer is we don’t have binaries for most of the systems, so we need to resurrect the old compilers in order to create binaries that can be emulated. And to do that we need a modern compiler that will compile the older compilers. We do have a few system under emulation: we run a Vax/VMS that hosts the Vax Imp77 compiler - a pretty definitive and relatively modern implementation of Imp77 - and we have Mouses running as you know. We have a sort of emulator for the PDP15 - but not the full system, just the compiler and runtime. And that’s it. Lack of manpower to produce anything else. If you wanted the APM to be emulated, try to twist Brian Foley’s arm. Maybe even Fred’s if he’s still interested, though I doubt he would be as he’s moved on in life. Bob Eager has show some interest in a 2900 emulator - there was a problem a few years ago in that ICL (or was it Fujitsu by then) was being proprietary about the 2900 architecture as they were still selling their own system to emulate their old legacy hardware. Bob was also the person who put together the set of sources for the IBM version of EMAS and could perhaps get it running under the Hercules emulator, but again that’s a huge amount of work (and needs compiler bootstrapping which I think is why he was working on a new Imp80 compiler) and I don’t know if he has the enthusiasm to take that on for an audience of maybe 2 or three people interested in seeing EMAS run again! We do have a tape of the Dec10 compiler which might work under a Supnik emulator, though I tried bringing up a Dec10 myself and didn’t recognise any of the system - I suspect the emulation I found was the wrong Dec10 O/S. But the Imp compiler is available if you want to try it. There is potentially an RK11 drive with a binary of “Guts” on it - the Groningen University Time Sharing system - the only O/S written in Imp outside the country. Harry Whitfield was the professor there. Compiled in Imp77 for the PDP11. (And the source of that PDP11 RECODE you mentioned earlier. btw we can find recode programs for most of the architectures but they’re not much use if you don’t have binaries to feed through them.) However I loaned the drive to someone in the Netherlands who said he could read the disk for us back in the 90’s and I never heard from him again. So that’s about it as far as old systems and what we have that might get them going again. By all means email me if you have questions or need help locating files somewhere in the archives. (I don’t always notice notifications about posts here, email is more likely to get to me).
PS Before mine, there was a contemporary Imp80 to C translator written by Peter Stephens of the ERCC/EPCL who wrote most of the EMAS Imp compilers. It was pretty good - given the limitations of standard C which meant that a few constructs could not be translated - but the source code of the compiler (which was a modified version of the regular compiler) had got out of synch with the grammar file describing the language, and when some constructs were hit (if I remember rightly anything that used records in all but the simplest ways) the compiler crashed. Lacking the correct grammar file to rebuild the grammar from, we were unable to repair it, and by that time Peter was enjoying his retirement and not interested in working on the same programs he’d spent the last 40 years working on, and who could blame him! So some years later I had a crack at imp2c - twice - once by decompiling Imp77’s ICode and once with a new parser I wrote from scratch - the first just wasn’t practical as the code it generated might work but was too simplified to be maintainable as an actual C program, and the latter failed to implement all the constructs and I hadn’t learned enough about compiler writing at that point to get it right. This third attempt in progress is after a few years more experience and I’m confident it will work. Most of the code is clean and maintainable; there’s one area that I was still learning as I wrote it (type matching for declarations and expression evaluation) and although that is coming together via a lot of ad-hoc individual cases, I don’t want to release it until I get it working and then re-design it more generally and more elegantly than the current work-in-progress. (Especially as I would like to turn this exercise into a book on how to write a transpiler!)