Earlier quoted context omitted.
Yes that's true in general, but ... I hate to be the party pooper here, but .... What makes this JS implementation deserve the name "Quick"? I noticed it doesn't appear to do JIT compilation or any of the fancy optimisations V8 does. So whilst it may start up quickly, and may interpret quickly, it won't actually execute JS quickly relative to V8, unless I missed something huge in the linked web page. I got the sense…
It seems to be relatively very fast in the space of small javascript interpreters meant for embedding. That's a different niche with different constraints.
QuickJS JavaScript Engine
241–250 of 279 posts
Re: QuickJS JavaScript Engine
#242qwertyoruiopz already found a use-after-free bug: https://twitter.com/qwertyoruiopz/status/1149424025111801858
There are other bugs, too, like: 1420 th = js_mallocz(ctx, sizeof(*th)); 1421 th->has_object = TRUE; 1422 if (!th) { 1423 JS_FreeValue(ctx, obj); 1424 return JS_EXCEPTION; 1425 } But hey, that's gonna get ironed out. :)
Even if the developer is a genius and the project isn't that big.
Re: QuickJS JavaScript Engine
#243I have a potentially dumb question as I'm way out of my element here. What would someone....do with this? Use it to run JS on some embedded device where you can run C?
I have a domain-specific Windows application that uses Google's V8 engine for hosting user-written scripts. It hasn't been upgraded for several years, and when I recently took a look at updating the V8 version it's linked with, I was dismayed at how bloated and complex V8 has become. Seems like it can't be compiled down to a single DLL anymore, at least not without turning the compilation into a miniature research pr…
Does the the application basically pass data to a user script (the user knows JS so it is useful for them?), and then the JS returns the data after processed?
Amusingly I asked the question and remembered that I actually worked on (supported) a hardware product that did this to some extent. It was a disaster as the scripting language would eat memory / cpu and crash the box ;)
Re: QuickJS JavaScript Engine
#244Earlier quoted context omitted.
I have two question in my mind. 1. Are there anyone on HN knows him in real life? 2. Does anyone have other people in their mind who is in the same league as this man? Mike Pall's LuaJIT sort of make him at this level but that is only one thing. Fabrice create things that everyone are using it one way or another, and if it wasn't HEVC patents mess we would have his bpg [1] replacing jpeg. [1] https://bellard.org/bpg/
Dan Bernstein. Researched curve 25519 and provided reference implementations of x25519 & ed25519. Invented chacha20, such that it never branches on user secrets to minimize side channel leakage. Along with poly1305, these form the foundation of almost all “modern crypto” from Signal to TLS v1.3. He wrote qmail as a superior MTA to the incumbent Sendmail. He’s even beat the US government in court.
Re: QuickJS JavaScript Engine
#245The benchmark scores [1] he gives only stack it up against other embeddable engines. It cuts those to ribbons, but can someone who's familiar with JavaScript performance weigh in on how it competes with the most popular engines like V8 and SpiderMonkey? It would be interesting if this is so fast that you could re-implement Node using QuickJS instead of V8, or even make a WebKit- or Gecko-based browser with QuickJS un…
Main purpose of them is to be a glue between native calls: take output of one native function and pass it as input to other. So instead of writing ray-tracer in JS you should write it as a native function (not even in webasm).
In my Sciter (https://sciter.com) I had the similar dilemma:
Either to use a) some compileable language (of V8 with JIT) or to use b) something small but to provide easy ways to extend script by custom native functions.
I've chosen b) and so the engine that does HTML/CSS and scripting is 6 times more compact than just only V8 binaries. For an embeddable engine that is clearly better.
For browsers, where running JS and no real ways for native code execution... they MUST have V8 and the like. That also leads to Electron problems... browser engines are simply not suitable to be used as embeddable UI engines, by design.
Re: QuickJS JavaScript Engine
#246Earlier quoted context omitted.
> 1. Are there anyone on HN knows him in real life? Do you ask this to know if he's a real guy or an AI or a pseudo for group of persons like https://en.wikipedia.org/wiki/Nicolas_Bourbaki ? I know Fabrice a little. He's definitely real, smart and humble. Visited him at his workplace about ten years ago when he worked at Netgem. We also have a common friend we visit with spouse and kids, where we discover and discuss…
I've met him as well, a few times, but do not know him personally like you. He is definitely very humble and a very good listener. When he told us about this side project he was working on about a year ago, he made it seem like it wasn't a big deal, just a small js engine, would never compete with v8. After a few questions, it was clear that the goal was to implement the latest ECMAScript spec, with all the goodies.…
With how things are going now, V8 code is the de-facto "upstream spec"
Re: QuickJS JavaScript Engine
#247 std.printf("%d\n", 1);
std.printf("%s\n", os.platform);
However it does not compile to a binary and doing something like: import std from "std";
import os from "os";
std.printf("%d\n", 1);
std.printf("%s\n", os.platform);
compiles via `./qjsc -m -o default_modules examples/default_modules.js` however does not execute: $ ./default_modules
SyntaxError: export 'default' in module 'std' is ambiguous
Source: https://github.com/smalldatatech/quickjs/blob/master/example...Re: QuickJS JavaScript Engine
#248I'm asking this here because I don't really know where else to do so: I'm trying to compile a binary from a js source that uses the standard modules (they are loaded by default if you run the interpreter) so the following works: std.printf("%d\n", 1); std.printf("%s\n", os.platform); However it does not compile to a binary and doing something like: import std from "std"; import os from "os"; std.printf("%d\n", 1); st…
import * as std from "std";
import * as os from "os";
std.printf("%d\n", 1);
std.printf("%s\n", os.platform)Re: QuickJS JavaScript Engine
#249I just tried building this on my Mac and it looked initially like it all was building fine, but it eventually failed when building qjs32. Thinking this probably didn't matter much I went ahead and ran `./qjs examples/hello.js` which worked as advertised – cool! Tried `./qjsbn examples/pi.js 5` and it worked as well – very cool! Then I tried `./qjs examples/hello_module.js` and got this: SyntaxError: unsupported keywo…
Heads up, I had to unset CONFIG_M32=y on macOS Catalina. There are no headers or symbols for 32bit apps in macOS anymore, so this will exclude the *32 variant targets.
Re: QuickJS JavaScript Engine
#250Earlier quoted context omitted.
Heads up, I had to unset CONFIG_M32=y on macOS Catalina. There are no headers or symbols for 32bit apps in macOS anymore, so this will exclude the *32 variant targets.
similar here. but I did not understand where CONFIG_M32=y is set. it is uncommented and must be set in somehwhere of Makefile. did not find the position.
ifndef CONFIG_WIN32
# force 32 bit build for some utilities
# CONFIG_M32=y
find it here.