chicken-hackers
[Top][All Lists]
Advanced

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

Re: [PATCH 3/3] Let scrutinizer infer types for foreign types with retco


From: Evan Hanson
Subject: Re: [PATCH 3/3] Let scrutinizer infer types for foreign types with retconv/argconv given
Date: Fri, 27 Dec 2019 14:27:57 -0600

On 2019-12-26 15:51, megane wrote:
> It would be ideal if we could add some bits of type information and let
> the scrutinizer infer the rest. I think that would need some thought,
> and/or experimentation.
> 
> In these patches I dropped the annotations that added no information the
> scrutinizer couldn't infer. For example in (* * -> *) the only
> information is the arity of the function, which the scrutinizer can
> infer.

Indeed. I don't want to make perfect the enemy of good, so I've pushed
these. I do think we should try to recollapse/resimplify the code in
`annotate-foreign-procedure' if we can get the scrutinizer doing the
right thing with those annotations (or with the stub call sites, like
you suggest in the commit message), but this is a good improvement for
now. Thanks megane!

> There's only 1 return value from foreign functions, too (right?).

Right; C_values, which is the only way to return multiple values from
foreign code, only works with foreign-primitive.

> There should a way for the user to override (if compatible) the type for
> definitions. If the user specifies (: foo (-> *)) the return type of foo
> should be * even if the scrutinizer could infer the actual return type
> to be, say a fixnum. That gives more freedom for a library writer from
> an API design perspective.

Yeah, ATM `##core#the' nodes are kind of doing two different jobs; one
is carrying user specifiations, and the other is passing info from one
compiler phase to another. I guess in the first case we don't want to
change anything, but in the second we want to improve the info wherever
possible. Could the "strict" flag on those nodes be used for this?

Evan



reply via email to

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