9fans archive / 1997 / 09 / 94 /    prev next

From: bobf@pla... bobf@pla...
Subject: No subject
Date: Fri, 12 Sep 1997 16:43:27 -0400

> Following on from everyone agreeing that alef is the right way to write
> applications in Plan9 and issues of porting your applications to other
> enviroment, how difficult would it be to port the IRIX version of the alef
> runtime and compiler to other posix'ish platforms for example. Does the IRIX
> version use lots of specific SGI features or given a resonable ammount of time
> would it be possible to port it ?

first of all, the Irix version of alef isn't a port; it is cross-built
from plan 9.  that is, i use the plan 9 compilers and loaders to produce
an Irix executable.

that said, "porting" the compiler and loader is the easy part.  since the
compiler and loader generate plan 9-style symbol tables, the debugger on the
target system probably won't understand the resulting executable.
you'll also have to bring along acid and some other utilities, like ar.
to get acid, you need to emulate the portion of libmach for
the target architecture and figure out how to map the plan 9 process
control model to that of the target system.  i had access to the Irix
source when i didit, so although i couldn't modify the operating system,
i was able to find enough rocks to hide process state under.  even then, the Irix
version of acid lacks some of the functionality of the plan 9 version.

of course, if you don't need a debugger for your alef programs, it should
be relatively easy to build the alef compiler and run-time library; mainly
you need to understand the target system's system call conventions and
multi-threading package.  the latter will have to be ported to plan 9.

if you want to truly port the alef compiler, then i can't be of much help
because we haven't done it yet.