[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] specialization
From: |
Jim Ursetto |
Subject: |
Re: [Chicken-hackers] specialization |
Date: |
Mon, 8 Aug 2011 02:09:59 -0500 |
On Aug 8, 2011, at 12:51 AM, Felix wrote:
> "specialization" means using the type-information obtained by the part
> of the compiler that performs an intraprocedural flow-analysis
> (enabled using "-scrutinize") and rewrite calls to core-library
> procedures that match a given set of argument types. There are quite a
> number of optimizations that can be done that way, starting from
> eliminating simple predicate calls up to using more efficient internal
> routines that omit argument checking.
Excellent!!
Does this (or will this someday) generalize to user types like SRFI-9 records,
so we can ditch most uses of record-variants?
Also, is the ##sys#check-* idiom still valid or do we need to rewrite it to a
conditional? I.e. is this string-append optimized:
(##sys#check-string x)
(string-append x "foo")
or must we write:
(if (string? x)
(string-append x "foo")
(error "not a string"))
and in fact does this get optimized too:
(unless (string? x)
(error "not a string"))
(string-append x "foo")
If I understand correctly it looks like any of the above will work.
Jim