On Wed, Jun 13, 2012 at 12:10 AM, Mark H Weaver <[email protected]> wrote: > Alex Shinn <[email protected]> writes: >> Implicit forcing can be done without any overhead except >> when actually making use of it. > > This is not necessarily true for monomorphic procedures that are > open-coded in a natively compiled implementation with error checks > disabled. For example, 'car' can be compiled to code that simply > extracts the field from the pair, without any conditional branches. > > Implicit forcing makes monomorphic primitives into polymorphic ones.
This is called an unsafe optimization - it assumes the program is correct, and breaks/segfaults when not passed the valid types. I'm not a fan of this optimization hack. The overhead of type checks matters primarily in tight loops, where the compiler should be able to infer most types. But if you want to rely on it, then you have to give up on implicit forcing - both are extensions not required by the standard. -- Alex _______________________________________________ Scheme-reports mailing list [email protected] http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports
