[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] [PATCH] Improve irregex matching performance a lot

From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH] Improve irregex matching performance a lot by adding two type declarations
Date: Sat, 12 Dec 2015 20:28:40 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

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[0].

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[1]
> 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
> declarations.

This is also already possible: a variable's type can be declared.  This
won't need to be changed.


Attachment: signature.asc
Description: Digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]