DEV Community

Discussion on: Is Javascript a compiled language?

 
lexlohr profile image
Alex Lohr

There is a gray area in which this discussion happens: virtual machines like .NET or the JVM.

One could make the case that code that runs on such a VM is also compiled, since the "bare metal" on which the actual code runs is just behind a small abstraction layer to allow independence from actual hardware implementation.

But here's the issue I have with the assertion that JS was a compiled language: if your language requires you to start a JIT compiler during run time in certain cases, you're disqualified from calling yourself "a compiled language", because then you go back to interpreter mode.

Granted, that shouldn't happen with most modern JavaScript code, but the language itself is a modern one that is still compatible with all of its bad parts.

Thread Thread
 
genta profile image
Fabio Russo

Granted, that shouldn't happen with most modern JavaScript code, but the language itself is a modern one that is still compatible with all of its bad parts.

Sure, but, there are too many code based on those "bad parts".
By fixing It, you will break lots of stuff all around the web.

Thread Thread
 
lexlohr profile image
Alex Lohr

That's why I refrain from calling JavaScript a compiled language. Please let's not break the web.

Thread Thread
 
qm3ster profile image
Mihail Malo • Edited

Yes, the fact new Function() doesn't capture scope makes it much better optimized, but both are still bad for security (esp in web) and performance.

Can't wait for native DOM access in WASM.

Let's break the damn web already!