3 ms·
Not really. It's using a bytecode IR (intermediate representation). An IR is effectively a mid-point between JS and machine code. The benefit of using it is a)
by jpgvm 4y ago
Not really. It's using a bytecode IR (intermediate representation).
An IR is effectively a mid-point between JS and machine code. The benefit of using it is a) it's generally executable by the interpreter with minimal processing b) it's still architecture independent so you can ship the same bytecode to multiple different MCUs. Fundamentally though it's just JS in a different representation rather than a "different language".
You probably could generate machine code directly. You can do this already (but generating large binaries unsuitable for embedded) with tools like GraalVM/SubstrateVM. It's actually a fairly difficult problem though due to nature of escape analysis and other things needed to compile highly dynamic languages efficienty.