3 ms·
I wish this myth of dynamic == interpreted, static == compiled would die. Interpreters are almost always written in statically typed compiled languages. When y
by sneed_chucker 3y ago
I wish this myth of dynamic == interpreted, static == compiled would die.
Interpreters are almost always written in statically typed compiled languages. When you feed an interpreter source code in Ruby, Python, Perl, etc. the net effect is that you have a compiled binary program that's executing your dynamic code.
So it shouldn't too great of a leap to understand that you can do full ahead-of-time compilation of dynamic code so long as you're prepared to embed a rich runtime into the binary.
Common Lisp is one of the most dynamic languages in existence, and has been ahead-of-time compiled for decades.
Of course, the dominant compilation paradigm for dynamic languages these days is "just-in-time" (e.g. JavaScript V8, Python PyPy, Ruby YJIT), because it allows you to use runtime frequency and type information to compile parts of the source more intelligently.
But either way, the whole "dynamic languages cannot be compiled" thing isn't true.