Sandro Magi <[email protected]> wrote: > On 30/03/2011 10:02 PM, Jonathan S. Shapiro wrote: > > The first is that BitC > > has inboard types, and this entails parametricity over sizes. If we > > assume a dynamic compilation component, this admits multiple solutions. > > If we require static compilation it seems hopeless. > > Depends what you mean by "static compilation". Cyclone had a paper on > dynamic code generation by stitching together code templates. You can > support link time code generation using this technique using all native > code. > > This looks pretty much like a static compilation pipeline, and doesn't > require a special IR that can describe the full language in order to > perform the code generation at link time.
I've always wondered why you couldn't just automate the way you have to do this in C: have a generic version of the function with hidden parameters containing the various necessary lengths and offsets. Sure, it' be less efficient, since it would have to call memcpy etc, but I don't see why it couldn't be done. The linker would just have to check whether a specialised version exists, and if not, manufacture one by making a function which passes the necessary data to the generic one. I suppose that is dynamic compilation, but only in a trivial sense. Alex _______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
