> But since we are compiling AOT and not JIT, we cannot de-opt/undo that guess if it becomes wrong - instead we would just crash. > > But we could define the type using type annotations (TS)! > > Now we have to do 0 checks of the type of a, since we already know it at compile-time. This can allow for some big speedups :) This comes with a big caveat that if the type assertion is wrong at runtime that the AOT'ed app w…
Agreed, I have it behind a flag because of this, in the (far) future I could enable by default if I write a type checker built-in or something. Thank you!