[Top][All Lists]

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

Re: [Chicken-users] More on aliasing.

From: Peter Keller
Subject: Re: [Chicken-users] More on aliasing.
Date: Mon, 8 Jul 2002 14:45:37 -0500
User-agent: Mutt/1.2i

On Mon, Jul 08, 2002 at 03:29:54PM -0400, Anthony Carrico wrote:
> On Mon, 8 Jul 2002, Peter Keller wrote:
> > Well, in machine generated C code, I can see why the current method was
> > used. Since a larger code generates the C code, it knows when type problems
> > might occur and you get a warning at the meta level.
> True for warnings, but then only the meta compiler really knows what is
> going on. Why not pass the information down to the C compiler too, so it
> can be used for optimizations?

Well, I think the information should propogate down to the generated C
code as well for the same reasons you think so(and I think the code would
be safer, and allow for better run time checking of the objects). However,
I don't know how much work that would be for the implementors.

> Given the readability advantages, the only reason I can think of to be
> worried is if the compiler might stop using registers. Do you know if this
> is a problem? Can gcc put a register sized union into a register (assuming
> nothing needs the union's address)?

Registers? Like this?

register union foo;

That keyword is only a hint to the compiler. Some compilers don't even honor
it at all. 

> > But in human written
> > code, people often use the struct+union method for this just to keep
> > everything straight both in the code and the mind.
> This would be useful for reading the Chicken compiler's code for the same
> reasons.

Yeah, that would be really useful..... as it stands, if I do:

(define scheme_func
        (foreign-lambda int "c_func" int))

I can't set a breakpoint on scheme-func in a nice way. I have to deduce
what f<number> function name it got mapped to and then hope I get
it right.

Debugging at the ffi layer in chicken is a bit off-beat.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]