11 votes

QuickJS: A new JS interpreter/compiler by Fabrice Bellard

5 comments

  1. [3]
    jgb
    Link
    Few developers can make me interested in a project on the basis of their name alone. Fabrice Bellard is one of those developers.

    Few developers can make me interested in a project on the basis of their name alone. Fabrice Bellard is one of those developers.

    3 votes
    1. [2]
      imperialismus
      Link Parent
      I didn't know him by name, but the list of software he's made is extremely impressive.

      I didn't know him by name, but the list of software he's made is extremely impressive.

      5 votes
      1. Greg
        Link Parent
        The ordering of that page makes it kind of amusing if you don't know what's coming, too: "Oh, cool toy projects, some interesting signal processing stuff, tech demo, wait, by far the most widely...

        The ordering of that page makes it kind of amusing if you don't know what's coming, too: "Oh, cool toy projects, some interesting signal processing stuff, tech demo, wait, by far the most widely used video library in the world... and one of the major emulation platforms?!"

        7 votes
  2. [2]
    unknown user
    (edited )
    Link
    Edit: BTW: this is the project homepage: https://bellard.org/quickjs/. Edit2: On Debian Testing I had to install gcc-multilib to compile it. Edit3: Just compiled a file with "use strict"; function...

    Edit: BTW: this is the project homepage: https://bellard.org/quickjs/.

    Edit2: On Debian Testing I had to install gcc-multilib to compile it.

    Edit3: Just compiled a file with "use strict"; function hello(){console.log("Hello world");} hello(); and it ended up 3.8 megabytes large (ELF binary).


    Just saw this on Mastodon. Bellard is the initial author of QEMU, TCC and ffmpeg, among other things:

    QuickJS is a small and embeddable Javascript engine. It supports the ES2019 specification including modules, asynchronous generators and proxies.

    It optionally supports mathematical extensions such as big integers (BigInt), big floating point numbers (BigFloat) and operator overloading.

    Some highlights from features:

    Small and easily embeddable: just a few C files, no external dependency, 180 KiB of x86 code for a simple “hello world” program.

    Fast interpreter with very low startup time: runs the 69000 tests of the ECMAScript Test Suite in about 95 seconds on a single core of a desktop PC. The complete life cycle of a runtime instance completes in less than 300 microseconds.

    Can compile Javascript sources to executables with no external dependency.

    Mathematical extensions: BigInt, BigFloat, operator overloading, bigint mode, math mode.

    Small built-in standard library with C library wrappers.

    2 votes
    1. [2]
      Comment deleted by author
      Link Parent
      1. unknown user
        Link Parent
        Indeed! I just tried a compilation with -flto option, and the difference is huge: 3828k vs. 960k; but the compilation takes considerably longer, real0m22.217s with -flto vs. real0m0.186s without it.

        Indeed! I just tried a compilation with -flto option, and the difference is huge: 3828k vs. 960k; but the compilation takes considerably longer, real 0m22.217s with -flto vs. real 0m0.186s without it.