I'm an admitted novice JavaScript programmer and am attempting to learn more. So I turn to you folks for help, with this easy question :). The O'Reilly book that I'm reading keeps referring to the compile-time of the JavaScript code. My knowledge of functional programming (scheme and the likes) tells me that the JavaScript is actually interpreted by the browser, most likely requiring two passes through the JavaScript.
Am I incorrect in my assessment? Or is the compile-time that the book references actually just the first pass of the interpreter, similar to how Perl or Python would function? Thanks!
JavaScript is an interpreted language, not a compiled language. A program such as C++ or Java needs to be compiled before it is run. The source code is passed through a program called a compiler, which translates it into bytecode that the machine understands and can execute.
As we discussed earlier, JavaScript is interpreted by an interpreter named Ignition as well as compiled by a JIT optimizing compiler named TurboFan.
Node. js uses V8 and it compiles the JavaScript as an optimization strategy. So, the JavaScript running at the server side via node.
JavaScript is actually interpreted line by line.
It is browser-dependent. Look up WebKit's SquirrelFish Extreme and Google V8 to see what's at the fastest end of things, and look at Mozilla's JaegerMonkey for that implementation.
AFIAK V8 and SFX are JITs, so they compile JS code to native. JaegerMonkey and TraceMonkey combine in Firefox to form a system where if code would be faster traced, TraceMonkey executes it, and if code were faster native, JaegerMonkey compiles it, just like SFX.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With