Using gRPC to generate FFI code, especially in WASM

25 views
Skip to first unread message

Rett Berg

unread,
May 6, 2020, 2:11:55 PM5/6/20
to grpc.io
For personal projects I have been considering the best way to address FFI boundaries between languages. This will become particularly important with wasm, where there is a memory/process boundary between modules. This article (section "nanoprocesses) shows how the memory model might be modeled with dependencies.

Something that struck me is that there is no good way to define these boundaries. The current standard to use C for all FFI is performant but far from safe -- what if these boundaries could be generated safely and at high performance (albeit not C performance).

If gRPC could generate code for FFI then it would allow interchanging services in a local running process or microservice almost trivially. With a sand-boxing architecture like wasm, the safety would not be sacrificed when making the code FFI vs microservice.

IMO gRPC is almost perfectly positioned to take advantage of this flexibility.
Reply all
Reply to author
Forward
0 new messages