|
|
|
|
|
by fenomas
688 days ago
|
|
> Because of structural subtyping, you can’t do that In practice v8 does exactly what you're saying can't be done, virtually all the time for any hot function. What you mean to say is that typescript type declarations alone don't give you enough information to safely do it during a static compile step. But modern JS engines, that track object maps and dynamically recompile, do what you described. |
|
> This gives you worse-than-JIT performance on all field access, since JITs can perform dynamic shape analysis.
We're talking about using types to guide static compilation. Dynamic recompilation is moot.