[Some news] QuickJS Javascript Engine

Talk about code development, features, specific bugzilla bugs, enhancements, patches, and other highly technical things.

Moderator: satrow

Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific referenced Bugzilla bugs, mercurial, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Most "bug reports" do not belong in this board and should initially be posted in Community Support or other relevant support boards.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
Al6bus
Fanatic
Fanatic
Posts: 228
Joined: 2015-08-24, 14:55
Location: Lemberg

[Some news] QuickJS Javascript Engine

Unread post by Al6bus » 2019-07-13, 08:20

French mathematician Fabrice Bellard, better known for working on ffmpeg, qemu, tcc and calculating pi, laid out QuickJS, a compact implementation of JavaScript as a C-language library, in open access.
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.

Main Features:
  • Small and easily embeddable: just a few C files, no external dependency, 190 KiB of x86 code for a simple hello world program.
  • Fast interpreter with very low startup time: runs the 56000 tests of the ECMAScript Test Suite in about 100 seconds on a single core of a desktop PC. The complete life cycle of a runtime instance completes in less than 300 microseconds.
  • Almost complete ES2019 support including modules, asynchronous generators and full Annex B support (legacy web compatibility).
  • Passes 100% of the ECMAScript Test Suite.
  • Can compile Javascript sources to executables with no external dependency.
  • Garbage collection using reference counting (to reduce memory usage and have deterministic behavior) with cycle removal.
  • Mathematical extensions: BigInt, BigFloat, operator overloading, bigint mode, math mode.
  • Command line interpreter with contextual colorization implemented in Javascript.
  • Small built-in standard library with C library wrappers.
https://bellard.org/quickjs/
https://news.ycombinator.com/item?id=20411154
Windows 7 Pro x64 - Pale Moon x86
We hope for e10s(multiprocessing) or another alternative implementation :)

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 24449
Joined: 2011-08-28, 17:27
Location: 58°2'16"N 14°58'31"E
Contact:

Re: [Some news] QuickJS Javascript Engine

Unread post by Moonchild » 2019-07-13, 10:59

What are you suggesting, that we replace SpiderMonkey with this?
"If you want to build a better world for yourself, you have to be willing to build one for everybody." -- Coyote Osborne
Image

User avatar
Al6bus
Fanatic
Fanatic
Posts: 228
Joined: 2015-08-24, 14:55
Location: Lemberg

Re: [Some news] QuickJS Javascript Engine

Unread post by Al6bus » 2019-07-13, 11:28

I do not offer anything, just inform. it may be useful in the future :think:
Windows 7 Pro x64 - Pale Moon x86
We hope for e10s(multiprocessing) or another alternative implementation :)

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 24449
Joined: 2011-08-28, 17:27
Location: 58°2'16"N 14°58'31"E
Contact:

Re: [Some news] QuickJS Javascript Engine

Unread post by Moonchild » 2019-07-13, 12:59

It's not possible to just swap out the JS engine (even if it was a separate, embeddable dll or whatnot) because it's tightly intertwined with DOM in a browser.
The JS engine might have full language support for the scripting, but that doesn't mean anything without being able to have it interact with DOM structures, and in turn page content, at many levels. It works great for standalone JS programs, of course, but that's all there is to it.
"If you want to build a better world for yourself, you have to be willing to build one for everybody." -- Coyote Osborne
Image

User avatar
Al6bus
Fanatic
Fanatic
Posts: 228
Joined: 2015-08-24, 14:55
Location: Lemberg

Re: [Some news] QuickJS Javascript Engine

Unread post by Al6bus » 2019-07-13, 15:00

I understood. Thanks for the clarification.
Windows 7 Pro x64 - Pale Moon x86
We hope for e10s(multiprocessing) or another alternative implementation :)

User avatar
Isengrim
Keeps coming back
Keeps coming back
Posts: 966
Joined: 2015-09-08, 22:54
Location: 127.0.0.1
Contact:

Re: [Some news] QuickJS Javascript Engine

Unread post by Isengrim » 2019-07-13, 15:02

Moonchild wrote:
2019-07-13, 12:59
It's not possible to just swap out the JS engine (even if it was a separate, embeddable dll or whatnot) because it's tightly intertwined with DOM in a browser.
Would it theoretically be possible to create a browser with swappable JS engines, rather than trying to modify an existing one? Or would that be "highly impractical or improbable"?
Linux Mint 19.2 Cinnamon (64-bit), Windows 7 (64-bit), Windows 10 build 1803 (64-bit)
"As long as there is someone who will appreciate the work involved in the creation, the effort is time well spent." ~ Tetsuzou Kamadani, Cave Story

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 24449
Joined: 2011-08-28, 17:27
Location: 58°2'16"N 14°58'31"E
Contact:

Re: [Some news] QuickJS Javascript Engine

Unread post by Moonchild » 2019-07-13, 16:09

Isengrim wrote:
2019-07-13, 15:02
Or would that be "highly impractical or improbable"?
I'd say highly impractical, impossible to maintain, and improbable.
"If you want to build a better world for yourself, you have to be willing to build one for everybody." -- Coyote Osborne
Image

Post Reply