Due to the dynamic nature of JavaScript this could be quite costly in general. You'd have to do secondary lookups on each "affected" property access in scope. Also this will be fun to spec with eval/with/Function.
-
-
Replying to @bmeurer @littledan and
I think we'd want to define it so that the extensions "win" and can't be changed. This would mean that if you get a hit by the time you're JITing, you can rely on the hit remaining stable.
1 reply 0 retweets 0 likes -
Replying to @wycats @littledan and
That's a minor thing. You still need to intercept every o.x because of could be one of these prototypes (assuming that x was listed in the extensions). And even worse every o[k] because k could evaluate to a property key in the extension list.
1 reply 0 retweets 2 likes -
Not saying it's not doable, but it comes at a cost.
1 reply 0 retweets 1 like -
Something in common among the other languages I amdon't aware of which support extensions is that they can be resolved more or less statically
2 replies 0 retweets 1 like -
Replying to @littledan @bmeurer and
Right. I think if we did this we would want very static resolution. I think that's a fair constraint.
1 reply 0 retweets 1 like -
Replying to @wycats @littledan and
Incidentally, Ruby's "refinements", which are this feature, are pretty static but could have been more static (and would have been better for it).
1 reply 0 retweets 1 like -
Replying to @wycats @littledan and
Static sounds good from the VMs perspective. Not sure how useful that is in the JavaScript world tho.
1 reply 0 retweets 0 likes -
Replying to @bmeurer @littledan and
If it's not static, it becomes very hard to understand. I participated a lot in the Ruby version of this conversation and became very convinced that the feature is more useful when static because it can be understood more easily.
1 reply 0 retweets 5 likes -
Replying to @wycats @littledan and
I can't really speak to that since I don't have the same background as you have, but I find your argument very convincing.
1 reply 0 retweets 1 like
In cases where user intuitions align with implementation considerations, you can build some awesome shit that isn't slow. I love finding those corners.
-
-
Constraints are liberating!
2 replies 0 retweets 2 likes -
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.