3 ms·
“Most” of the currently popular languages? That’s true for C++ and maybe Java and C#. Is that true for python or javascript? Swift? It’s definitely not true f
by josephg 4y ago
“Most” of the currently popular languages?
That’s true for C++ and maybe Java and C#. Is that true for python or javascript? Swift?
It’s definitely not true for newer languages like Scala, rust or zig.
- xmcqdpt2 4y agoScala is object oriented and anyway even if you write non OOP code it ends up (usually) on the JVM so you still get all the virtual tables stuff. If anything idiomatic Scala usually has significantly more pointer indirection than Java.
- bheadmaster 4y agoCPython uses function pointers heavily, although not for vtables, but hash tables (since almost everything in Python is a hash table). I don't know about V8 and JVM, but even if they managed to avoid function pointers, they still rely on JIT compilation, which is as problematic for non-von Neumann architectures, if not worse. I should've phrased things differently not to imply that all of them use vtables - vtables was just the first example that popped to my mind.