Open katat opened 1 month ago
So as long as a type implements a known signature (e.g. Type.add(Type) -> Type) we would automatically route a + to that function right? Sounds like a good idea
Yes, we will need this assumption until noname support trait.
It would be nice to support builtin operators like + - / % << >> etc for both field and uint types.
Instead of implementing them as via builtin interfaces, like this pending PR, it would be better to implement them in native noname code, which are easier for maintenance.
To achieve this, we would map these operators to the native functions, such as uints.
The mapping could be in the MAST phase, where the builtin operator AST nodes can be replaced with function calls to the native stdlib.