Re: A92: PlusC, so what?


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

Re: A92: PlusC, so what?




I'm the person who wrote Sage (the other C compiler for the 92). I never
finished it and since you aren't picking up my code where I left off I'm
assuming it is too messy for you. Altough I would like to discuss with
you how you are going to write it because it takes a lot of planning in
the beginning. Also I would like you to use my memory management code as
I think I coded it very well. It was complete and would be able to judge
which register if any a variable should be put in. Also it could keep
track of all of the variables on the stack. I would be happy to
integrate it with your already existing code. And also I'll be able to
help a little with your compiler. I'd probably be better at turning the
parsed code into assembly.

Grutsch Alexander wrote:
> 
> PlusC is ANSI compatible, but what should I use for libraries. When you
> compare C with Libraries, Libraries are similar to classes with functions.

ANSI C has 2 ways of doing this. One is to just put in a normal function
proto type for a function in any library. Then call it from anywhere in
the program. Then when the source is compiled the compiler doesn't
really know if the function exists or not; it just sees a proto type for
it and assumes it does. Then when its linked the compiler goes back
through it and fills in all of the correct addresses and makes sure that
the functions exist. This method is used with static libraries, and
implict dll linking.

The other way is with explict dll linking. In it you at run time load up
a library and get a handle for it. Then you get a pointer to a function
at runtime also. You have to then cast this pointer to a previously
defined function type.

If we were going to use this second method for the calculator we would
either need to go more low-level into the assembly header files and go
low-level enough that a function would control library loading, but this
wouldn't look too good. But we could use some C defines to make macros
that used inline assembly. Then we would have to only do some extra
stuff to the inline assembly part. And we would not then be breaking the
ANSI standard for C.

> BTW In about 4 days the first sources are availabel (but nothing in
> direction code generation works, only the preprocessor and the structure is
> written)
Where? What kind of classes are you going to be making. I would like to
comment on how you plan to implement it.
> 
> --
> MXM-TriX
> http://start.at/mxm


References: