News for hackers. Stuff that matters.
Re:The Crack Programming Language by seanmcdirmid on Monday November 26, 2012 @01:45AM (#4830947)
Why do you think run time dispatch is that slow? With static typing you can setup an efficient vtable, while even with just dynamic typing there is a lot of cachingq you can do to reduce call overhead. Static analysis helps for some inlining, but the gain isn't more than a few percent.

Garbage collection and run time safety checks probably cost more than call indirection.

Re:The Crack Programming Language by dietrichepp on Monday November 26, 2012 @01:55AM (#4830971)
Call indirection prevents inlining. It's not about comparing indirect calls versus direct calls, it's about comparing indirect calls against no function call at all.

For example, imagine a function that multiplies two matrices. If the matrices are statically typed, the resulting function would only need to allocate the result. If the matrices aren't statically typed, you need to dispatch on the type of each element in each matrix. That will take much longer.

Yes, there are ways around this in languages with dynamic dispatch. However, my point is that LLVM won't do it for you.