Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!ucla-cs!zen!ucbvax!decvax!ima!johnl From: johnl@ima.UUCP Newsgroups: comp.compilers Subject: machine independent executables Message-ID: <660@ima.ISC.COM> Date: Sun, 16-Aug-87 21:45:36 EDT Article-I.D.: ima.660 Posted: Sun Aug 16 21:45:36 1987 Date-Received: Tue, 18-Aug-87 05:15:07 EDT Sender: johnl@ima.ISC.COM Reply-To: Robert Manson Lines: 30 Approved: compilers@ima.UUCP Return-Path: There has been a discussion on comp.unix.wizards about multiple machine executables (attempting to solve the portability problem, making it easier to compile a program to run on several machines). Anyone over here have an opinion? One suggestion was to use a pseudo-machine code and an interpreter; however, I think the loss in speed would be a major drawback. I think the pseudo-code would be a good idea. However, why not make a compiler for the pseudo-code? Many machines use a similar architecture; I'd think (in my naivete) it'd be easy to design a code to take advantage of that fact. The code (assuming it were similar enough to the machine code of the machine it was running on) could be compiled each time it was loaded into memory, making it convenient to use (not having two versions laying around). I sincerely believe this is a very good idea. I would be willing to go so far to write a C compiler for such a "machine" (assuming someone else were to design the machine) if there were enough interest. Of course, it might be possible to use an existing compiler (anyone know of any that could be suitably modified)? Bob Manson ...{ihnp4,cbosgd}!tut!manson [This is a topic that has been around for a while. Compiling to a byte code and interpreting is quite commonly used in, for example, the Pick system. Machine independent intermediate code, though, is a famous black hole, particularly when you are trying to deal with machines with different word sizes, addressing architectures, and byte orderings. The best known example is Pascal P-Code, which works at the expense of making all machines act sort of like a CDC 6600, its original host. -John] -- Send compilers articles to ima!compilers or, in a pinch, to Levine@YALE.ARPA Plausible paths are { ihnp4 | decvax | cbosgd | harvard | yale | cca}!ima Please send responses to the originator of the message -- I cannot forward mail accidentally sent back to compilers. Meta-mail to ima!compilers-request