Porting the Zed compiler
G. B. Bonkowski, W. Morven Gentleman, Michael A. Malcolm · 1979
Zed is the base language used to implement the portable realtime operating system Thoth[7], and to write commands, utilities, application programs, and other software which run under Thoth. (Zed is similar to C, although language details are not important in this paper.) One of the founding principles of Thoth is our experience that the hardest problems in porting programs usually arise when interfacing to different operating systems. By porting the whole operating system first, we ensure that other programs see the same system interface. Hence, with a modicum of care in programming, programs can be machine independent in that, without change, they can be compiled for any machine to which Thoth has been ported. Since the Zed compiler is a program which runs under the Thoth operating system, it is portable in this sense, and the same source serves to produce either native mode or cross compilers because it does not depend on the machine on which the compiler will run.Compilers, in common with certain other “system software”, are, however, machine specific in that the output from executing a compiler must be different depending upon the machine on which that output is destined to be run. Clearly, for Thoth to be ported to many machines, the compiler should be portable in this second sense: as much as possible of the source of the compiler should be machine invariant, that is, independent of the target machine, and for those parts which are machine specific, there must be a well organized scheme to assist realizing versions for new machines. The Zed compiler is designed to ease such ports. Actually, the objective is broader than that, because the initial port is only part of the problem: once versions of the compiler are available for several machines, we still have the problems of maintaining all these different versions, enhancing them, and evolving them to follow changes in the language. To do this, we need a structure that is easy to understand and to work with. We also want to minimize the amount of source code for which multiple versions must exist.
Cited by 3 works. doi:10.1145/800229.806958
Authors
References
- Compiler construction for digital computers
- The design of an optimizing compiler
- Thoth, a portable real-time operating system
- Implications of structured programming for machine architecture
- The portability of the BCPL compiler
- A Machine Independent Algorithm for Code Generation and Its Use in Retargetable Compilers
- A transportable extendable compiler
- Formalization and automatic derivation of code generators.
- Experience with the pascal P‐compiler
- The translation and interpretation of stab‐12