Current one is not so great when it comes to typechecking return statements. Also it cannot typecheck functions that are dynamic in their nature. Good example of one is switch from examples/switch.stacky. It requires more sophisticated type system then stacky ever will have.
Also with current type system, expressing function types is impossible, making call keyword untypecheckable.
Additionaly, functions like:
two-dup fun over over end
are impossible to type check due to lack of type variables in type signatures. First solution that I have in mind is to add keyword dynamic for functions that's type are resolved at call side. Example with new syntax:
Current one is not so great when it comes to typechecking
return
statements. Also it cannot typecheck functions that are dynamic in their nature. Good example of one isswitch
from examples/switch.stacky. It requires more sophisticated type system then stacky ever will have.https://github.com/RobertBendun/stacky/blob/d9cf84971b9fcdb08a2642ea9bf04c7055e73f7f/examples/switch.stacky#L3-L21
Also with current type system, expressing function types is impossible, making
call
keyword untypecheckable.Additionaly, functions like:
are impossible to type check due to lack of type variables in type signatures. First solution that I have in mind is to add keyword
dynamic
for functions that's type are resolved at call side. Example with new syntax:Maybe shorten it to
dyn
. (Rust uses shorter one for different stuff)