Follow

QuickJS was an interesting project to study! It's a small JavaScript engine that's still well optimized and feature complete without going overboard.

Since I mentioned line counts earlier QuickJS takes ~80k, over half of which is in one file.

It's implemented as a bytecode stack machine with what V8 calls "hidden classes".

Also has a REPL loop with a syntax highlighter, C transpiler, uglifier, and I/O library. Could replace Node.js quite well!

bellard.org/quickjs/

@Madmonkey Basically the only reason to do that replacement is if you care about the complexity of your dependencies.

You'd sacrifice some performance to do so, but not significantly so.

@Madmonkey That small codesize comes from it being developed by two guys rather than a large corporate team...

@alcinnz

But Node.JS is really extended and covers a lot of needs. I think weight is because of this.

@Madmonkey Most of those modules should be portable to QuickJS.

Node.js itself, last I checked, is little more than an integration between V8 and libev. QuickJS reimplements the V8 part itself, which is massively complex.

Sign in to participate in the conversation
FLOSS.social

For people who care about, support, or build Free, Libre, and Open Source Software (FLOSS).