A small but complete JavaScript engine
21–30 of 151 posts
Re: A small but complete JavaScript engine
#22https://web.archive.org/web/20110726063943/http://www.freear...
No mention of his secret sauce other than, well, things bore him and he moves on.
Re: A small but complete JavaScript engine
#23Earlier quoted context omitted.
I realize you're joking, but a company called Samsung actually did something similar already: https://nodejs.org/
Serious question, why is this a joke? Couldn't javascript be just another language to replace bash?
Re: A small but complete JavaScript engine
#24Could this potentially be used in a browser? How complete is “complete”? Browser diversity is top of mind for me...
As far as does this implement enough JavaScript features for websites to run, https://test262.report/ looks really promising! You would have to hook it up to DOM and network and all sorts of other APIs normally provided by browsers, though. One reason you might not want to build a general-use browser on QuickJS is performance. QuickJS is one of the fastest JS interpreters in its weight class, but engines like V8 achi…
Re: A small but complete JavaScript engine
#25Earlier quoted context omitted.
I realize you're joking, but a company called Samsung actually did something similar already: https://nodejs.org/
Serious question, why is this a joke? Couldn't javascript be just another language to replace bash?
Re: A small but complete JavaScript engine
#26 const m = {year: 2019, month: 12};
console.log(m); // [object Object]
Compare with Node: { year: 2019, month: 12 }Re: A small but complete JavaScript engine
#27Re: A small but complete JavaScript engine
#28Pretty cool, but cant print basic objects const m = {year: 2019, month: 12}; console.log(m); // [object Object] Compare with Node: { year: 2019, month: 12 }
Node does some custom fanciness, but Object.prototype.toString() is equally correct.
Re: A small but complete JavaScript engine
#29> Can compile Javascript sources to executables with no external dependency. Is QuickJS a viable way to write command-line apps in JavaScript? In particular, does it have enough of a standard library to work with, or would it be a struggle because (I assume) it can’t use packages from NPM? I know there’s the alternative of bundling Node.js and V8 into an executable, but the resulting binaries are large - it feels lik…
https://bellard.org/quickjs/quickjs.html#std-module
It would be enough for a good number of CLI tools, I'd think. But one big issue is going to be that every library on NPM is hardcoded to use Node's modules (e.g. fs) so you're not going to be able to use any external modules at all.
Re: A small but complete JavaScript engine
#30Unfortunately because it lacks stuff like JIT it'll never rival the likes of V8 in performance. But in terms of bang for buck it's unbeatable.