You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The methods at the bottom that implement the "wrapping" are quite generic and I would imagine generating them with a wrapper would be quite possible. This had me wondering, if it would be possible to utilize this fact to generate a C API using a macro or build step? A lot of people may use Rust by now - but many people are used to working on complex things such as browsers with C or C++. Offering a concrete C API would also open the door for any other kind of language utilizing FFI. Take for instance: Use Ruby to create a minimal web-tech based app.
My personal usecase would be to build a browser using FLTK, which is in C++. So I'd need ways to bind Servo to C, so I can utilize it from there.
This would also have to include the JS engine - when stuff like resizing the window is called, I'd have to forward that to FLTK. The easiest way would be to obtain raw JS value pointers off Servo and utilize the SpiderMonkey C API to implement window methods and other things alike.
What do you think about this? Would generating a C API like this be possible, or is Servo too complex in that regard?
The text was updated successfully, but these errors were encountered:
I have been looking a lot into FFI lately due to working on a module for a scripting language to port the dyncall library in. During that time, I had been shown a lot of Rust FFI examples, and one stood out to me in particular: https://github.com/shepmaster/rust-ffi-omnibus/blob/master/examples/objects/src/lib.rs
The methods at the bottom that implement the "wrapping" are quite generic and I would imagine generating them with a wrapper would be quite possible. This had me wondering, if it would be possible to utilize this fact to generate a C API using a macro or build step? A lot of people may use Rust by now - but many people are used to working on complex things such as browsers with C or C++. Offering a concrete C API would also open the door for any other kind of language utilizing FFI. Take for instance: Use Ruby to create a minimal web-tech based app.
My personal usecase would be to build a browser using FLTK, which is in C++. So I'd need ways to bind Servo to C, so I can utilize it from there.
This would also have to include the JS engine - when stuff like resizing the window is called, I'd have to forward that to FLTK. The easiest way would be to obtain raw JS value pointers off Servo and utilize the SpiderMonkey C API to implement window methods and other things alike.
What do you think about this? Would generating a C API like this be possible, or is Servo too complex in that regard?
The text was updated successfully, but these errors were encountered: