News for hackers. Stuff that matters.
Re:Sciter, the 5 MB Electron alternative, has switched to Ja... by eawoifjaiowepfj on Thursday December 30, 2021 @10:58PM (#29744722)
I wonder why they used QuickJS instead of a faster engine like V8 or JSC?
Re:Sciter, the 5 MB Electron alternative, has switched to Ja... by c-smile on Friday December 31, 2021 @12:48AM (#29745362)
"a faster engine like V8"

It is actually not the fact that V8 in context of Sciter alike use cases will be faster.

Consider this statement:

    document.body.patch(<body>Hello world</body>);
In case of Sciter this expression runs with native speed. JSX is built-in and element.patch() method is native.

While in browser, in case of ReactJS, you will run that patch() (reconciliation procedure ReactDOM.render) with JS VM speed as that algorithm is implemented on JS/TS.

The whole point of Sciter is in its embeddability - you can add native objects of your app callable directly from script. Check this example of native object: https://github.com/c-smile/sciter-js-sdk/blob/main/demos/int...

So you really don't need V8 JIT infrastructure to achieve max performance - just add native objects when needed.

Re:Sciter, the 5 MB Electron alternative, has switched to Ja... by longstation on Thursday December 30, 2021 @11:02PM (#29744737)
My guess is probably the QuickJS has less resource usage compared to the more performant V8.

UPDATE: Now I have read the linked article, here is the reasons (copied from the article):

API and integration principles are close to what TIScript uses – it took me just 1 month to add QuickJS to Sciter core. And 4 months more to expose HTML/CSS runtime to JS.

Relatively compact implementation – QuickJS is slightly more fatty (by 100 kb) but still in acceptable range. For the note: full version of V8 is about 40 mb – 5 times larger than Sciter itself;

Liberal MIT license. Sciter cannot use GPL/LGPL code – many customers expressed this requirement;

Readable source code. Well… almost readable.

Re:Sciter, the 5 MB Electron alternative, has switched to Ja... by zamadatix on Thursday December 30, 2021 @11:04PM (#29744757)
There is a section with the key reasons it was picked, in particular:

"Relatively compact implementation – QuickJS is slightly more fatty (by 100 kb) but still in acceptable range. For the note: full version of V8 is about 40 mb – 5 times larger than Sciter itself"

Re:Sciter, the 5 MB Electron alternative, has switched to Ja... by samus on Thursday December 30, 2021 @11:11PM (#29744802)
40mb is just nuts. These days, jlink would allow me to shrink a Java JVM down to something like that. And that would already include some nontrivial batteries, which Javascript doesn't AFAIK.
Re:Sciter, the 5 MB Electron alternative, has switched to Ja... by gigel82 on Thursday December 30, 2021 @11:19PM (#29744857)
A full V8 is 8Mb on 32bit Windows and 12Mb on 64bit Windows, so not sure where that 40Mb is coming form.
Re:Sciter, the 5 MB Electron alternative, has switched to Ja... by c-smile on Thursday December 30, 2021 @11:46PM (#29744998)
Pure V8 - yes, close to 8 Mb - that is still larger than whole Sciter that beside of script VM contains HTML/CSS/Graphics, etc.

40 Mb came from Node.JS distribution (V8 + native runtime = node.exe). Sciter is more comparable to NodeJS as it includes good chunk of NodeJS alike runtime too.

Re:Sciter, the 5 MB Electron alternative, has switched to Ja... by ncann on Friday December 31, 2021 @12:37AM (#29745307)
While I appreciate the conscious size-saving effort, I need to ask: is 30 MB difference that big of a deal for desktop applications nowadays? A random Electron app that I download will easily take up hundreds of MBs disk space.
Re:Sciter, the 5 MB Electron alternative, has switched to Ja... by CamperBob2 on Friday December 31, 2021 @12:47AM (#29745359)
That's the wrong question, IMO. The right question is, "Does it need to be that big?" The answer is "No."

Things that are too big are usually composed of smaller things that are also too big.

Re:Sciter, the 5 MB Electron alternative, has switched to Ja... by 8note on Friday December 31, 2021 @01:56AM (#29745685)
The proper question is: what's the cost of it being that big? Is it acceptable? Is it worth making it smaller?
Re:Sciter, the 5 MB Electron alternative, has switched to Ja... by WastingMyTime89 on Friday December 31, 2021 @05:20AM (#29746571)
I personally don’t think it’s acceptable and the disregard for files sizes generally extends to disregard for RAM usage which is even more unacceptable. Sadly I don’t really have a choice regarding using most of these apps.
Re:Sciter, the 5 MB Electron alternative, has switched to Ja... by CamperBob2 on Friday December 31, 2021 @12:46AM (#29745353)
Is it even possible to distill V8 into a single Windows DLL anymore? The version I use was about 3.5 MB in 2013. I tried updating it a couple of years ago, but quickly gave up and backed away, groping for the doorknob.
Re:Sciter, the 5 MB Electron alternative, has switched to Ja... by gigel82 on Friday December 31, 2021 @02:12AM (#29745740)
It's possible though not straight-forward. React Native Windows seems to have a version of V8 wrapped with JSI (for use in React Native) though by the looks of the project, it appears to be only used internally and not really meant for stand-along consumption: https://github.com/microsoft/v8-jsi
Re:Sciter, the 5 MB Electron alternative, has switched to Ja... by numpad0 on Thursday December 30, 2021 @11:27PM (#29744907)
I wonder what are the global scale environmental consequences will be, long term. Could it make a difference between couple nuclear reactors urgently needed and no longer needed?