3 ms·
To be fair, their still is a difference between Objective-C and C# and Java (which the OP was trying to contrast). Dynamically dispatched (i.e. a table look-up
by bronxbomber92 14y ago
To be fair, their still is a difference between Objective-C and C# and Java (which the OP was trying to contrast). Dynamically dispatched (i.e. a table look-up or pointer dereference) doesn't change the fact that the callee (the method to be executed after being found by the runtime) or the caller (code sending the message & perhaps all the runtime doing the lookup) are both compiled into executable code. This is surely different than how Java and C# are compiled/executed (in most cases) -- which I think was the intended point :).
- spullara 14y agoJava and C# are compiled into machine code before execution. Also, Objective-C isn't table lookup or pointer dereferenced, it is more akin to a (cached) reflective lookup and dispatch.
- bronxbomber92 14y agoYou're right that method invocations aren't simply a table lookup or pointer dereference, but in the end it boils down to a jump to the address of some all ready compiled (machine) code which is what I was trying to make a point of. For C#, the execution process is C# -> compiler -> CIL bytecode at compile time. Then at runtime CIL bytecode -> JIT -> machine code. So sure, C# (and I believe Java is similar to C# in this regard) eventually gets compiled to machine code, but it's vastly different from what I believe to be the accepted usage of being a "compiled language." The exception to this being if you AOT compile your code, but in that case you lose sacrifice some language functionality.