On Sat, Jul 27, 2013 at 9:13 PM, David Jeske <[email protected]> wrote:
> Has there been any look at causing typeclass-instance selection to be > implicitly lexically scoped in the caller? > Indirectly, yes. There's a whole black art of merging dictionaries that is driven by the desire to avoid passing 20 to 30 dictionary pointers around. The reason to want to collapse the dictionaries out eagerly is that it lets you inline them without requiring an explicit dictionary pointer at all. > This is effectively admitting that one reason we don't explicitly > parameterize the implementation of ord to begin with is the cumbersomeness > of handing the parameter through arbitrary call-stacks to reach it's > intended destination. However, our goal is in fact to offer control of the > Ord implementation to the caller, or we would not have used a polymorphic > mechanism at all. > I suppose you could say that. My practical response for all this is that the right way out is run-time or link-time instantiation. One reason for that response is that you almost *have* to do it when you allow unboxed types to be parametric, because you *really* want to be able to size the call frame at static compile time. It's hypothetically possible to pass a dictionary of field offsets and compile things to use overwhelming amounts of indirection, but it's probably faster to produce a code template in which the offset fields have to be link-time resolved and then clone-and-resolve the procedure at the time of the first call. shap
_______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
