Coffeehouse Post

Single Post Permalink

View Thread: is managed code faster than native?
  • User profile image

    There is major things that I feel constitute what I expect out of dynamic languages:

    • Types as values instead of types as variables
    • Duck typing
    • Optional metaprogramming / reflection

    I'd like to really know why, on an objective level, these features would effect performance in any way, that a static language would not suffer from, ie. from virtual calls or type casting when needed to do certain things in a static language like I/O or polymorphism and some kinds of signalling. Reflection/metaprogramming is the one feature that I can see really complicating optimization (especially AOT), because it allows the programmer to literally f**k with code in arbitrary ways at runtime. But that sort of thing is optional even in dynamic languages and I think it's just "slow" in any language that offers it.

    I like strongly typed dynamic languages. Also, the language doesn't need to be compiled at runtime, it could have a compiler that precompiles directly into machine code, if this improves performance.

    Just to be specific..a dynamic language still should have a rich type system that exposes a reasonable amount of the functionality available on the CPU. If it only supports is the String datatype or floats, well that's not really what I'm looking for.

    JavaScript/V8 engine is pretty interesting because at least on Debian's benchmark game it performance competitively with Mono and Java (both considered very fast), despite having inherited JavaScript's various optimization difficulties and not doing any precompilation like they do, oh and being significantly newer.