Assembly output of JavaScript program

Posted on
  • I'm interested in the assembly output of different JavaScript interpreters, and I was wondering if there's any way of running espruino on Linux and get a dump of the instructions that the interpreter outputs? Something like this for node/io.js.

  • Espruino is kind of unique in that it doesn't actually compile to bytecode. If you've got a small embedded device then there isn't enough room for the sourcecode and bytecode - and one of the main points of Espruino is to have the sourcecode on-chip so you can edit it without any special tools on the host PC.

    There's some info at:

    However you can easily compile for Linux: https://github.com/espruino/Espruino

    And there's an experimental compiler that compiles a subset of JavaScript into C++ code, that can then be compiled to native code.

  • So there's no easy way of comparing what Espruino runs against other interpreters?

  • So there's no easy way of comparing what Espruino runs against other interpreters?

    No, in fact it's running the code in a totally different way - interpreting directly from the characters you wrote, rather than via bytecode.

    It means it's super-fast for stuff like eval, but the more iteration gets done, the more it loses out to interpreters that compile to bytecode or JIT.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Assembly output of JavaScript program

Posted by Avatar for petergombos @petergombos

Actions