[Some news] QuickJS Javascript Engine

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
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 bugs, git, the repositories, 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. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

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
Lunatic
Lunatic
Posts: 288
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 x64
We hope for multiprocessing

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35484
Joined: 2011-08-28, 17:27
Location: Motala, SE
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?
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Al6bus
Lunatic
Lunatic
Posts: 288
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 x64
We hope for multiprocessing

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35484
Joined: 2011-08-28, 17:27
Location: Motala, SE
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.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Al6bus
Lunatic
Lunatic
Posts: 288
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 x64
We hope for multiprocessing

User avatar
Isengrim
Board Warrior
Board Warrior
Posts: 1325
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"?
a.k.a. Ascrod
Linux Mint 19.3 Cinnamon (64-bit), Debian Bullseye (64-bit), Windows 7 (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: 35484
Joined: 2011-08-28, 17:27
Location: Motala, SE
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.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Locked