Hi,
I was wondering - we could technically use the Servo engine as a frontend tool if it becomes embeddable (for frontend design of GUI applications, such as Mail, Word processing, etc.). This excludes the Javascript engine, which is written in C++ and has been known for memory attacks. Servo is more optimized than stuff like Electron. Once we get Servo to run on Redox, we could have both a good browser (let’s face it: we can’t make our own browser) plus a RAD tool. Especially as a layout engine.
This could reduce the effort for maintaining OrbTK. Not saying that is should go away, but writing an own layout / rendering engine that can handle advanced features such as layout / animation / etc. is a huge undertaking, simply from the structural part (architecture, etc.). We should really not focus on making yet another rendering library, especially when a good solution (like Servo) already exists.
Currently, the problem is that Servo handles only Javascript events. It would maybe be feasible to make a custom fork of the Servo project and write a wrapping API that can accept Rust events instead of Javascript and expose that as an API in a shared library. This is still less work than writing a full rendering engine. Other operating systems use someting like GTK or KDE for drawing - in Redox this could be libservo.
The goal would be that everthing including the compositor would be written in HTML + CSS - even the window styling could be done. Servo has very good frame times so far, performance and memory usage should not be an issue.
For this to work, the following support would be needed:
- Graphics drivers - an OpenGL implementation. Servo can go as low as OGL 2.1, so that would be the minimumn that has to run.
- Multithreading that works with rayon.
- Windowing system - Sevo uses glium as an underlying driver (which is a safer wrapper around OpenGL than sdl2). Redox should be able to open a glium window and reduce the dependency on a C-based library such as SDL2.
If that isn’t possible, we should at least look into webrender as a rendering engine. It does not have layouting capabilites, but at least things Redox is missing, such as gradients / animations, etc. The goal is to let Mozilla do the heavy lifting of writing all the rendering code.
What do you think about this?