Consider generating rust bindings for IPDL actors
Categories
(Core :: IPC, enhancement, P3)
Tracking
()
People
(Reporter: nika, Unassigned)
References
(Blocks 1 open bug)
Details
Updated•8 years ago
|
Comment 2•7 years ago
|
||
Updated•7 years ago
|
Comment 4•5 years ago
|
||
Since WebGPU is largely implemented in Rust, we could greatly reduce the boilerplate if we could access the IPDL entry points on GPU process side from Rust directly.
Comment 5•3 years ago
|
||
(In reply to Dzmitry Malyshau [:kvark] from comment #4)
Since WebGPU is largely implemented in Rust, we could greatly reduce the boilerplate if we could access the IPDL entry points on GPU process side from Rust directly.
"Me too." This would significantly reduce the amount of code in dom/webgpu that is simply passing Rust values through C++, IPDL, C++, and then Rust again.
Comment 6•3 years ago
|
||
exporting IPDL structs to rust
I think the initial comment here assumes that IPDL would serve as an inter-language exchange, with C++ senders driving Rust receivers and vice versa. While it seems essential for an actor written in one language to be able to manage actors written in the other, allowing the parent and child sides of a single protocol to be implemented in different languages seems both difficult and not necessary:
-
"Not necessary": we could restrict IPDL to same-language exchange, and it would still be very useful. I would expect many, if not most, modules to have the parent and child sides written in the same language.
-
"Difficult": the set of types that can be sent over IPDL is open-ended: anything that specializes
ParamTraitscan be sent, and the encoding is whatever theReadandWritemethods say it is. It's also difficult for all the usual reasons that FFI is hard when the type systems don't line up. It helps that IPDL has to serialize everything anyway---we know we're doing a copy, so that gives us a chance to reformat things---but not all problems go away: what is the C++ equivalent of a Rust enum?
If we restricted IPDL to same-language exchange between parent and child, then Rust protocols could use serde for serialization, as the analogue of ParamTraits on the C++ side.
Updated•3 years ago
|
Description
•