You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I committed to a branch that exposes arity for exports so that it can later be used to optimize compilation and avoid call1/call2 functions in many cases. However, it should just be an optimization, and so it should be possible to always be able to use call2/call3 as a fallback, even if slower. As long as go has a fallback that is slower, this is a viable path. If it doesn't have a fallback (or if other languages do not) then the solution is to make lambdas be emitted with their arity tagged.
var myFunc = [
3,
function(a, b, c) { return a + b + c; }
];
In Golang functions are first class, it supports creating closures, and passing them as values, but Golang is statically typed, so this tagged lambda needs to be specialized for types of parameters, and declared somewhere on top...
For backends like Golang arity tests in runtime are going to be troublesome to implement, and are very likely to be inefficient.
I wonder if it's possible to statically check if we're currying, or it's time to actually call something?
The text was updated successfully, but these errors were encountered: