3 ms·
I wouldn't have thought `become:` was an example that distinguished a dynamic programming language from others. Where have you seen it used as an example in th
by igouy 5y ago
I wouldn't have thought `become:` was an example that distinguished a dynamic programming language from others.
Where have you seen it used as an example in that way?
- pjmlp 5y agoIt doesn't distinguish per se, it is rather a good example of something that a dynamic language can make that in a single call makes invalid all assumptions that JIT might have gathered until that point. As for become: usefulness, Gilad Bracha explains it better than ever will, https://gbracha.blogspot.com/2009/07/miracle-of-become.html https://gbracha.blogspot.com/2009/07/miracle-of-become.html
- beagle3 5y agoHe does not address JIT efficiency here. A likely implementation is just “lets drop all assumptions related to the type of A”. It would work, but frequent use would kill performance. Python has all the issues that “become” has, with hundreds of “assumptions might have changed” points along common execution paths. Liajit, for example, hoists everything it can outside of loops rather quickly, because it knows the cases “become” or Python equivalent can happen, and they are rare and uncommon in idiomatic Lua code.