4 ms·
I assume latent type means simply the implicit typing. i.e. you declare a variable with the value, and the type is inferred through the value of the variable ra
by __Joker 12y ago
I assume latent type means simply the implicit typing. i.e. you declare a variable with the value, and the type is inferred through the value of the variable rather than the explicit type declared.
- kmavm 12y agoHi, I'm one of the paper's co-authors. As usual, the abstract really isn't enough to draw big conclusions from. The concept of a latent type applies to arbitrary expressions, not just variables. All the values flowing through a PHP program implicitly share the same union type; they can be floats, strings, arrays, etc. The latent types are the narrower types that can actually flow through the program in practice. To be clear, it is more general than just things like: $a = 0; // $a is an int! It includes learning that: g(foo() . bar()); foo() and bar() return strings. Since none of this information is marked syntactically in PHP, and since it might actually be undecidable because of dynamic control flow in the callees, dynamic binding, etc., you really need to see the program run to do this stuff.
- amelius 12y agoI'm wondering: how does this compare speed-wise to other real-world JITs. For example, node.js (V8). Are there any tricks used in your VM which are not used by V8, and conversely?