3 ms·
From the title it would seem it is boiled down to a completely statically-typed language, but it isn't. e.g. type casts are no-ops. Instead, every object acces
by pornel 7y ago
From the title it would seem it is boiled down to a completely statically-typed language, but it isn't.
e.g. type casts are no-ops. Instead, every object access is type-checked at runtime. `any` still exists and for unions and complex types it still performs full lookup by name (instead of RTTI/tagged unions or such).
So it's not really a static language, but a cut-down JavaScript runtime that instead of optimizing objects with hidden classes at runtime, does similar thing with vtables ahead of time.
- mmoskal 7y agoExactly. 'Static' refers to control flow which is static (no eval etc.). Handling of data is dynamic, with static types used as hints. It's also meant to run on a very constrained microcontrollers (think a few kB of RAM), and compile inside of a client-side webapp (both of which make it hard to use things like AssemblyScript).