3 ms·
> Q: Do you have a JavaScript JIT compiler? > No, we have a traditional AST interpreter that is being replaced by a bytecode VM. You can track the LibJS test26
by andsoitis 4y ago
> Q: Do you have a JavaScript JIT compiler?
> No, we have a traditional AST interpreter that is being replaced by a bytecode VM. You can track the LibJS test262 score for both backends here. I’m not convinced that the complexity and security burdens of a JavaScript JIT are reasonable, and given recent developments like Microsoft Edge’s Super Duper Secure Mode, I’m interested in pushing for best-effort JIT-less performance while keeping the codebase simple.
Always excited to see new JS engines. I'd be curious to see where LibJS's performance / code simplicity / memory balance tends towards over time.
- zxspectrum1982 4y agoI wonder if a new implementation of JavaScript was needed. My first hunch would have been to try Fabrice Bellard's QuickJS: https://bellard.org/quickjs/ https://bellard.org/quickjs/
- paoda 4y agoIt definitely wasn't needed, but it goes against what I think makes SerenityOS so special. That being that everything in SerenityOS and its several related projects is made from scratch.
- greenthrow 4y ago> If you wish to make an apple pie from scratch, you must first invent the universe. They are using Qt and C++. They have chosen where to draw a line, which is fine, and that line happens to be on the other side of "Javascript Engine".
- sph 4y agoTo be fair Qt is just to create the window on Linux, but all the browser internals are their own.
- greenthrow 4y agoIt's also being used for networking.
- LeFantome 4y agoFor now… Everything is from scratch on SerenityOS. Ladybird takes as much of that as it can but the is not afraid to use existing tech for the bits of Serenity that cannot currently be used on Linux ( the GUi framework and networking ).
- deleted 4y ago[deleted]
- bowsamic 4y agoThey are not using Qt in Serenity, only on Linux in order to hook up painting and events. Also, they are making a new programming language (Jakt) to replace a lot of the C++
- asddubs 4y agoI guess a precise defition of the line would be something like "no third party code dependencies"
- iopq 4y agoQt is not third party?
- sp332 4y agoWell... not if you're using KDE as your window manager?
- asddubs 4y agofor their operating system (serenityOS) they're not using any dependencies, they have their own windowing framework. for the cross platform version of the browser, they use Qt instead. but on serenity itself the browser does not use it.
- iopq 4y agofair enough
- coldtea 4y agoI think they'll replace Qt with their own GUI lib eventually - and they're already building their own language to replace C++ (for their uses I mean)...
- lioeters 4y ago> they're already building their own language to replace C++ Of course, every respectable software project sooner or later invents its own language!
- deleted 4y ago[deleted]
- unclad5968 4y agoEvidently the line is a curve and did not include a third party JS engine, since the project doesn't include a third party JS engine.
- greenthrow 4y agoI know. I think you did not understand my comment.
- dom96 4y agoThis actually makes a lot of sense, especially when you consider that WASM is now a thing.
- cestith 4y agoIt's worth noting, as I'm sure you already noticed, that they are supporting WASM in addition to JS. So maybe the right answer for "your simple, secure bytecode JS interpreter is too slow" really is "Just precompile that slow part to WASM".