The new compiler organisation is based on early monomorphisation. Initially I deliberately wrote the optimiser to work directly with polymorphic entities. I did this to be absolutely certain that Felix didn't make the same mistake as C++, and allow unprincipled dependent name lookup, in other words, to ensure the polymorphism was parametric.
Indeed, most of the back end works by retaining polymorphic functions, and uses an instantiation table to generate instances. The monomorphisation pass was added to improve optimisation opportunities, and in particular, when typeclasses go added we want to be able to inline methods: its no good finding the specialisations at the last minute when generating code because its too late to do any inlining. The new monomorphisation routine is done early, before inlining. It monomorphises reachable symbols so the "copy used" pass isn't required at this point. It eliminates type classes, so inlining doesn't have to do that check any more. And it reduces cloning to argument specialisation, instead of also requiring type specialisation. Once I get it working I will slot it in front of the optimisation. This will actually slow the compiler down until I remove the typeclass checking and rewrite the inliner to assume monomorphic code. For the back end, instantiation is no longer required at all, since it already done. So eventually stuff should be a bit faster. the copy-used algorithm remains a nasty bottleneck and also needs to be rewritten to garbage collect in one pass. -- john skaller skal...@users.sourceforge.net http://felix-lang.org ------------------------------------------------------------------------------ Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language