4 ms·
Can Servo be used as an Electron replacement?
by mthoms 6y ago
Can Servo be used as an Electron replacement?
- rezmason 6y agoThat's the spirit!
- Narann 6y agoCould be awesome! But it would need a JS engine.
- MayeulC 6y agoWhy would it, though? Any language should do, as long as you can package a runtime for the environment. Be it lisp, WASM, plain old C... It's just functions to call, that change the DOM, CSS properties, load pages, perform computations, call APIs... Of course, the thing you lose is the hardware and software abstraction layer provided by chromium's javascript APIs. Those could be exported to a select number of languages, it wouldn't be hard for a single dev to create a usable runtime in their language if they are provided with C bindings to the H/SAL...
- Narann 6y agoThanks, is there a public Servo C API with function calls to change the DOM?
- asajeffrey 6y agoNot yet, there is an embedding API, but it's designed for embedding into native apps. Servo uses Spidermonkey rather than v8 as the JS engine, so integrating into the node ecosystem would be tricky. But it would be nice to see a JS-first runtime system built around Servo!
- CodesInChaos 6y agoI'd guess many Electron users don't care about the node.js parts at all, they simply choose electron because it's more popular than the alternatives like CEF.
- Technically 6y agoNode has done a lot of work in defining a runtime outside of the browser. I'm guessing much of this work would need to be done with spidermonkey in order to match common functionality. It'd also help out an electron equivalent for gecko, too.
- CodesInChaos 6y agoSome electron users are certainly take advantage of the features node.js provides. But others just want a html+js based UI on top of a local webserver written in their preferred language. My ideal model would be having one piece of trusted javascript which works similar to web extensions which can control the window, trigger navigations, approve or deny permission requests by origins and can interact with the current web control. Any advanced integration with the host operating system would happen though the local webserver (which could be implemented in node.js if that's your thing, or in C#, Rust...). This would not require many changes to a browser runtime.
- skyfaller 6y agoWhat about Deno, rather than Node? (I know almost nothing about either, sorry if this is a stupid question.)
- jayflux 6y agoDeno uses V8 just like Node does so the problem would be the same
- Ygg2 6y agoCould Servo use v8 as the JS engine?