Closed marekjm closed 8 years ago
This will probably mean that type descriptions should be made available to the compiler.
Proposed syntax (a 30 seconds idea): .function: name::of::the::callable / minimum-arity (Parameter, Types) -> ReturnType
This issue will require a real compiler to be written for the machine. Or at least the assembler will have to be beefed up with some more features.
I decided not to beef the assembler up since I started writing a compiler for higher-levelish language into Viua assembly. However, functions' types can be encoded in bytecode as debugging information.
Available information about function's type is not enough. Currently, only
Function
type is returned.Type of a function should include:
Arity can be trivially detected by the compiler by counting parameters. It can also be explicitly given.
Return type can also be detected, in case it is not given explicitly. Ambiguous return types should be a warning.
Parameter types should be spelled explicitly.