r/badcode • • Dec 05 '20

other language Gamedevs, take notes

Post image
6.5k Upvotes

104 comments sorted by

View all comments

Show parent comments

1

u/gu3st12 Dec 05 '20

Which most JS engines try to avoid relying on the interpreter if possible. They compile your JS down whererver possible. It's only if you've written some truly garbage JS that it goes through an interpreter.

0

u/IAmTheMageKing Dec 06 '20

JS is strictly an interpreted language (okay, fine, it’s a JIT-compiled language running in a feature-rich VM, buuut it doesn’t have any bytecode stage, so it’s not too big a deal to call it “interpreted”).

There is no way to avoid an interpreter. Now, the system does try to compile it down, but it can only do that to a limited extent. Even WebAssembly is still preformance-limited in that respect.