Live data from Hacker News

QuickJS JavaScript Engine

bellard.org

141–150 of 279 posts

Re: QuickJS JavaScript Engine

#141
post #83

Earlier quoted context omitted.

Many projects use duktape ( https://duktape.org/ )

There's also XS6 engine. But I dislike the macro trickery in that one. Looks like QuickJS doesn't use setjmp/longjmp, as opposed to duktape. I really like this, as it will simplify memory management inside C functions, and allow to use gcc cleanup functions.

So I used QuickJS for a while today and it's the easiest JS engine of those I used so far (Duktape, XS6) to embed, even without extensive docs.

I can't be happier that it doesn't use setjmp/longjmp to handle exceptions. It makes memory management easier.

Everything is very straightforward. You can even get ref leaks report if you use -DDUMP_LEAKS.

Re: QuickJS JavaScript Engine

#142
post #106

Earlier quoted context omitted.

yes! he has been one of my favorite programmers over all these years. so happy that he continues to dispel the 10x programmer myth. at least, as far as i am concerned. we should all take note. it's less about productivity but more about focus and hard work. this project seems to have started in 2017. from a quick glance at the code, they used c (his favorite language) -- which by the way people are still there convin…

> from a quick glance at the code, they used c (his favorite language) -- which by the way people are still there convincing us not to use. Here is an alleged UAF in this library https://twitter.com/qwertyoruiopz/status/1149424025111801858

that's an excellent point. kudos for that hacker!

Re: QuickJS JavaScript Engine

#143
post #138
post #131

I 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?

You have a C app, and want to allow to script parts of it via JS easilly. I use engine like this inside the milter daemon for my postfix mail server, to process mail during reception.

Thank you!

Re: QuickJS JavaScript Engine

#144
post #110

qwertyoruiopz 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. :)

Re: QuickJS JavaScript Engine

#145

Earlier quoted context omitted.

yes! he has been one of my favorite programmers over all these years. so happy that he continues to dispel the 10x programmer myth. at least, as far as i am concerned. we should all take note. it's less about productivity but more about focus and hard work. this project seems to have started in 2017. from a quick glance at the code, they used c (his favorite language) -- which by the way people are still there convin…

> so happy that he continues to dispel the 10x programmer myth What do you mean by that? The only way I see him dispelling that myth is that he's a 100x programmer instead of a 10x.

https://twitter.com/BrendanEich/status/1149418907247104000?s...

Re: QuickJS JavaScript Engine

#146
post #139

Does anyone know is this is x86 specific? It sounds like it’s just C but I’m not at a computer right now so I can’t dig in. It seems really interesting for embedded or mobile (iOS/Android) too

It's not x86 specific.

Re: QuickJS JavaScript Engine

#147
post #107

> An online demonstration of the QuickJS engine with its mathematical extensions is available at numcalc.com. It was compiled from C to WASM/asm.js with Emscripten. This is peak JavaScript. How deep can we go?

Your comment reminded me of this talk: https://www.destroyallsoftware.com/talks/the-birth-and-death...

Re: QuickJS JavaScript Engine

#149
post #131

I 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 project in itself.

So there's definitely a need for more lightweight contenders in this space.

Ideally someone would just do an "stb"-style JavaScript interpreter that would fit into a single .c or .h file. This is closer to that ethos than most other candidates, and as others have noted, Fabrice's credibility as a '1337 h4x0r gives it an instant leg up on the competition. I don't have an urgent need to switch away from V8 right now, but I'll be watching this project with moderate interest.

Re: QuickJS JavaScript Engine

#150
post #96
post #25

Is there anything that Fabrice can't do? I mean, FFMpeg is almost a PhD thesis in and of itself, and he still manages to find time to make TinyC, QEMU, and now this. To say I'm jealous of his skills would be an understatement.

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/

I get a similar "is this by some kind of super-human intelligence?" feeling reading stuff from Oleg Kiselyov. http://okmij.org/ftp/
Post reply on HN