On Fri, Aug 13, 2010 at 1:14 AM, Max Bolingbroke <batterseapower@hotmail.com> wrote:
On 12 August 2010 20:31, Johan Tibell <johan.tibell@gmail.com> wrote:
> Yes and dead code elimination should also be able to get rid of much of the
> code duplication even before it reaches the linker.

I don't think dead code elimination will help, because presumably you
want to generate specialisations on demand. This means that
specialisations will only be generated if they have at least one
caller. Unless the caller is itself dead, it will be entirely up to
the linker to common-up stuff and reduce the code bloat.

I guess I was thinking that if you naively duplicated the whole Map module (instead of individual functions) once per caller then much of the generated code would become dead as the caller is unlikely to use all the functions in the module.

Cheers,
Johan