4 ms·
Initial thoughts: - Seems to be using gradual typing - type annotations are optional but, if used, are enforced (at run-time if necessary). The traditional pro
by pansa2 6y ago
Initial thoughts:
- Seems to be using gradual typing - type annotations are optional but, if used, are enforced (at run-time if necessary). The traditional problem with this approach has been poor performance - is that an issue here? Can you use `List<Int>` as a type annotation (which would presumably be O(n) to check at runtime) or only `List`?
- Appears to use a Python-like object model (e.g. fields are public by default). I can’t find detailed information about access control, inheritance etc.
- Significant indentation plus Ruby-style blocks. Would be interesting to see how well those work together in practice.
- ErikCorry 6y ago(I work at Toitware) Yes, it's gradual typing. Currently we don't have generic collections, so it's just List, but certainly something that we are thinking about. Dart is another language we have worked on. It has typed collections, but I think we'll do it slightly differently. But passing a List<int> to a function isn't O(n) in Dart, and I don't think I'm promising too much when I say that it won't be O(n) in Toit either :-) Performance is pretty good, at least compared with other interpreted languages (Toit is currently interpreted). About an order of magnitude faster than Python on comparable hardware.