On Fri, Feb 13, 2015 at 12:04 PM, Keean Schupke <[email protected]> wrote:

> I would rather specify this at the module level, rather than have things I
> have no control of happening. The function user should be able to control
> how they want it to apply in their module, without affecting anything else
> so:
>
> import 'C' add(int32, int32) -> int32 as int32 -> int32 -> int32
>
> So the compiler knows the native calling convention and how I intend it to
> type check.
>
> I don't like the way F# does this implicitly.
>

>From the standpoint of cleanliness, I agree with you. The problem is that
solving this only at module level isn't good enough. The programmer MUST be
able to look at the line of code in front of them and understand which
things do not allocate. Not allocating 99% of the time just isn't good
enough.

Given your proposal, consider a function using curried application that has
been constrained by a NOALLOC effect. Does an algorithm exists that is
guaranteed to perform curried application without any allocation, in the
case where the function being applied cannot be statically resolved, and so
we cannot guess the function's native arity given that you propose it
should not be encoded in the type?


shap
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to