Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Very interesting point of view.

I see a fourth option:

- compile the scripting language to C (like Crystal for Ruby)



The 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.


Yes but you can bootstrap the compiler.


The 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.


Modern Smalltalk environments are bootstrapped as well.


Python already has this through Cython: http://cython.org/


Crystal compiles directly to native code, it doesn't rely on C compilers for the last step.


Sure, but then you lose any advantage using a scripting language gives you.


That and you lose the advantage of what JIT compiling can get you.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: