5 ms·
Very interesting point of view. I see a fourth option: - compile the scripting language to C (like Crystal for Ruby)
by vmorgulis 10y ago
Very interesting point of view.
I see a fourth option:
- compile the scripting language to C (like Crystal for Ruby)
- duaneb 10y agoSure, but then you lose any advantage using a scripting language gives you.
- natermer 10y agoThat and you lose the advantage of what JIT compiling can get you.
- deleted 10y ago[deleted]
- brettcannon 10y agoPython already has this through Cython: http://cython.org/ http://cython.org/
- ufo 10y agoThe biggest gains of JIT is that you can use knowledge gained at runtime to generate specialized code and skip lots of the runtime checks that are typical of dynamic languages. You can't get rid of these checks if you compile the source language to C so from this point of view compiling to C is going to be just as slow as writing a traditional interpreter in C.
- vmorgulis 10y agoYes but you can bootstrap the compiler.
- ufo 10y agoThe implicit runtime checks in a Python program get converted into explicit if-statements if you use an ahead-of-time compiler to compile it to a static language like C. Bootstrapping will not be able to magically get rid of these if statements. Not to mention, bootstrapping is about the compiler executable and the problem I was talking about applies to any attempt to use an ahead-of-time compiler for a dynamic language.
- pjmlp 10y agoModern Smalltalk environments are bootstrapped as well.
- pjmlp 10y agoCrystal compiles directly to native code, it doesn't rely on C compilers for the last step.