6 ms·
> just like in every other mainstream language JavaScript doesn't do this, you can replace properties of window at will. I don't think Ruby does it, or Lua. PH
by duckerude 4y ago
> just like in every other mainstream language
JavaScript doesn't do this, you can replace properties of window at will. I don't think Ruby does it, or Lua. PHP probably does it under some circumstances in modern versions but only because it's remarkably un-dynamic for an interpreted language.
This is normal fare for high-level interpreted languages, for better or worse.
- SemanticStrengh 4y agoand yet I'm pretty sure JS can inline just fine
- munificent 4y agoIf by "just fine" you mean, "with incredible engineering resources funded by a small number of large companies with deep pockets and with some performance cost to check that the optimization is still valid", yes.
- duckerude 4y agoIt can, but it doesn't have a "do reasonable things" mode. Instead it notices when you do something unreasonable and undoes its optimizations.
- masklinn 4y agoSure, so can pypy. But that means you have to add all sorts of dependency tracking, such that you are able to deoptimise any function affected by mutation on things which were optimised in or out. This means your complexity increases very fast, very high, before you can have anything which actually works.