[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] Improve irregex matching performance a lot
Re: [Chicken-hackers] [PATCH] Improve irregex matching performance a lot by adding two type declarations
Sat, 12 Dec 2015 20:28:40 +0100
On Sat, Dec 12, 2015 at 09:47:14AM -0800, Dan Leslie wrote:
> > And even if there are other Schemes with type hints (I'd love to hear if
> > I've overlooked any!), I doubt they use a compatible syntax to ours,
> > which means a wrapper macro would be pretty hairy.
> Off the top of my head, there is also Kawa.
I can't say I find the documentation very clear, but it looks like it
doesn't really use these declarations to optimize code (which is the
goal of this patch).
> > Maybe this is a good feature to add: a way to indicate that a type
> > declaration for the argument types to a procedure declared elsewhere
> > should be considered an assumption in the procedure body.
> I'm afraid that I don't quite follow. Do you mean a CL-style declare
> within the body of the function; or do you mean that there may exist
> type declarations elsewhere that modify the function's type signature,
> and whose possible existence is implied?
The latter. We already allow this, in fact. But the compiler only uses
it to check and optimize the arguments and return value's types at the
call sites. What I'm proposing is to extend this somehow to indicate
that the assumption may also be made inside the procedure.
> Let's keep in mind that it's not only function parameters and return
> values that may benefit from type declarations; as with CL-style declare
> statements, it could be useful to pepper other symbols with type
This is also already possible: a variable's type can be declared. This
won't need to be changed.
Description: Digital signature
Re: [Chicken-hackers] [PATCH] Improve irregex matching performance a lot by adding two type declarations, Kooda, 2015/12/08