|
|
|
|
|
by coldtea
1867 days ago
|
|
>Oh wait, achieving native speed is close to impossible for a dynamically-typed language. It's actually quite possible, and depends on the scenario. A dynamically-typed language can analyse actual runtime type use and specialize function calls with a JIT, for example. It's also possible (and there's work in this area) to keep the specializations around for quick startup in the next runs... (and of course, drop them if they no longer hold). That's how Javascript is much closer to native than Python - in some cases just 2-3 times slower than C. Lisp did very well too (better than more than a few static languages). And that's with the extreme meta-programming / reflective behavior (which both Python and Javascript have). With less such, one could make a dynamic typing language that can be trivially JITed to run very close to native. |
|
- Strongtalk from the 1990s
- Pharo Smalltalk (Cog VM)
Also worth looking at
- Chez Scheme
And
- JavaScript in every popular modern browser.
And
- Luajit