[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inferno and UNIX

the following message, which appeared on the list late
last year, might be of interest in this context.
given the state of C programs i've had to import into
a Unix environment, i'd say the last sentence is, if anything,
a considerable understatement!  it's getting harder, too,
thanks to those awful configure scripts, and what they
imply about the programs they configure.

 From interstice.com!owner-inferno Mon Dec  9 16:17:12 GMT 1996
 From: plan9.bell-labs.com!dmr
 To: interstice.com!inferno
 Subject: re: C/C++ compiler?
 Sender: interstice.com!owner-inferno
 Precedence: bulk
 Reply-To: interstice.com!inferno

  Is there any really big reason why a C and/or C++ compiler couldn't
  be developed to compile code for Inferno?  Obviously, you'd miss out on
  the benefits of Limbo, but then lots of really useful tools could be
  ported easily to the Inferno environment.
The C language proper could be compiled without undue difficulty into
safe Dis code.  Probably the crucial realization for the compiler-writer
is that a C pointer needs to be represented as an array, and for the
C program-writer (or adapter) that the ANSI/ISO standard is more strict
in what it promises than most people realize.  Some things look tough
to do without help from the run-time (setjmp/longjmp), some seem tough
(like variadic argument lists) but might yield to careful thought.
Some things (like function pointers) aren't visible in Limbo but
have been anticipated (at least in stub form) in the interpreter.

It would be an interesting exercise, in that it might provide an
environment that enforced conformance, even at run time, to
the C standard.  On the other hand, I'd bet that the X windows
server and libraries would be really hard to port.