ultralight-ux / Ultralight

Lightweight, high-performance HTML renderer for game and app developers.
https://ultralig.ht
4.67k stars 195 forks source link

QuickJS Support #304

Open akrymski opened 3 years ago

akrymski commented 3 years ago

Would be great to support alternatives to JavaScriptCore, such as the lightweight QuickJS.

adamjs commented 3 years ago

Yeah I agree, or even disable JS completely by stubbing out the JSC interface.

FWIW, JavaScriptCore is pretty tightly coupled to WebCore at the moment (if you want to poke around the source, the main interface between WebCore and JSC is https://github.com/ultralight-ux/WebCore/blob/master/Source/WebCore/bindings/js/ScriptController.cpp).

An easier target for now is to try to selectively reduce the size of JavaScriptCore-- we can compile it without support for the various JIT compilers and WebAssembly which shaves about 15MB off the binary. I've gone ahead and done this in the latest release for 1.2.0 stable (see the min packages).

akrymski commented 3 years ago

Thanks, I'll check it out. If I wanted to implement an alternative language to JS would that also be the place to do it? In particular I'm interested in being able to manipulate the DOM directly in C instead of using a scripting language. That would open up possibilities to write native apps in new languages like Rust and Nim using WebCore for rendering without the overhead of JS.

If there is a way to selectively eliminate WebCore features to support some new-ish subset of HTML (5 only) and CSS (eg flexbox and maybe grid should be all you need for layout for example, drop support for floats etc) would be interesting.

Are you using the embedded WebKit branch btw? Seems relevant.

On Fri, 30 Oct 2020, 20:29 Adam Simmons, notifications@github.com wrote:

Yeah I agree, or even disable JS completely by stubbing out the JSC interface.

FWIW, JavaScriptCore is pretty tightly coupled to WebCore at the moment (if you want to poke around the source, the main interface between WebCore and JSC is https://github.com/ultralight-ux/WebCore/blob/master/Source/WebCore/bindings/js/ScriptController.cpp ).

An easier target for now is to try to selectively reduce the size of JavaScriptCore-- we can compile it without support for the various JIT compilers and WebAssembly which shaves about 15MB off the binary. I've gone ahead and done this in the latest release for 1.2.0 stable (see the min packages).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ultralight-ux/Ultralight/issues/304#issuecomment-719781756, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADKMFZFKX3NCPIZYKMAU53SNMO2LANCNFSM4SYZCJ6Q .