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!
Can I ask WHY replace Node.JS?
@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.
OK, so technical reasons, not ethical in some way.
@Madmonkey That small codesize comes from it being developed by two guys rather than a large corporate team...
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.
@alcinnz transpiler to C or from C?
@grainloom To C.
@alcinnz there's Fabrice, at it again 🤩
For people who care about, support, or build Free, Libre, and Open Source Software (FLOSS).