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

Re: Goo porting questions



On 28 Jul 2002 18:39:39 -0400, "Jonathan Bachrach" <jrb@ai.mit.edu>
said:
> no this is too heavy handed.  the bigger problem is that some
> primitive functions in boot are defined INLINE and do not occur in a
> header and it would be a bit more complicated to produce a header file
> c file produced.  

This leads to something about the .NET port as well. When compiling C
code for .NET it requires all functions to have prototypes (ie. be
declared before use). That means somehow generating the prototypes in a
header file that gets included by other files. Currently I manually add
the prototypes as needed. 

The approach of generating header files though is likely to be a huge
pain and complicate the build process. I'm beginning to think that for
a serious .NET port it'd be better to eventually go for a C# backend
rather than modify the g2c backend to fit into something that's so
different to a standard C build. But that's a whole lotta work!

> i do now have a mechanism for doing my own inlining
> of ast but this is a bit slower than the c compiler at this stage of
> goo's life so i would like to know if this is indeed a problem.

I think punting to the C compiler for inlining is a good approach in
that you get the advantage of all the heuristics the C compiler uses as
to whether to actually in line or not. On the downside, inlining in 'C'
is not standard (did it make it into C99?) so it's possible some
platforms won't support it.

> i would hate to have target specific builds as this compromises our
> ability to produce one set of c-files / makefiles per platform.  

I agree with this. 

> given that this isn't possible, would it be
> possible to either produce all makefiles or perhaps write a program
> that can translate a platform independent makefile (say using sexprs)
> producing other platform specific makefiles?  

I like this approach. Perhaps generate the GNU makefile and a platform
independant one that contains the same information you are throwing
into the GNU makefile. Then another program (or Goo routine) could do
the conversion to MSVC makefile, Symbian MMP file, etc.

Chris.
-- 
  Chris Double
  chris.double@double.co.nz