News for hackers. Stuff that matters.
Re:Fuchsia IDL Overview by spc476 on Thursday March 17, 2022 @03:51AM (#30708629)
QNX makes no distinction between IPC and RPC. In fact, a program won't be able to tell if the other end of a message port was on the same CPU, same computer, or network (well, maybe by timing results). You didn't even need to recompile code to get that either. It just works right out of the box.
Re:Fuchsia IDL Overview by surajrmal on Thursday March 17, 2022 @04:05AM (#30708708)
When you do this, you have to live by the combined constraints of both transports. It's not necessarily wrong, but having different mechanisms which are optimized for the specific constraints of each is also valid.
Re:Fuchsia IDL Overview by ithkuil on Thursday March 17, 2022 @04:12AM (#30708749)
I wonder how many of those constraints actually apply to the IDL and surrounding programming model as opposed to the mere (de)serialization.

Could we have a single IDL that generates two sets of serialization code one optimized for IPC and the other for network transport?

Re:Fuchsia IDL Overview by surajrmal on Thursday March 17, 2022 @12:00PM (#30712596)
I'll give you a more concrete experience. We have protocols designed to take advantage of shared memory to allow dma directly from the hardware to the pages backing the file you end up reading from. There are many layers/processes between my program and the driver which ultimately talks to the hardware, and being able to bypass copies for the data is useful. Now the protocol encodes this expectation of shared memory usage within it. We later built a mechanism to take existing protocols and use them across network boundaries, but were unable to utilize any protocols which relied on shared memory. It may be possible to emulate shared memory across the network boundary, but it's hard to do so performantly in all cases. So rather than modify the existing protocol to avoid shared memory, negatively affecting existing use cases, we opted to create a second protocol which was optimized for network use cases.

There are more of these sorts of examples I could enumerate if you find it worthwhile.

Re:Fuchsia IDL Overview by pjmlp on Thursday March 17, 2022 @05:39AM (#30709274)
COM, .NET Remote and RMI do it.
Re:Fuchsia IDL Overview by Kinrany on Thursday March 17, 2022 @11:31AM (#30712226)
It should be possible to encode those constraints as part of the language. For example, the distinction between sync and async calls can be represented by having a Future type and wrapping the return type in it.
Re:Fuchsia IDL Overview by znwu on Friday March 18, 2022 @04:19AM (#30719750)
Sync and async are all about cooperatively yielding control flow. However, in many cases, you may want to yield control on IPC, or to hold onto control on RPC. Yielding control depends on the sender logic. IPC/RPC depends on receiver characteristics. They are very orthogonal concepts.
Re:Fuchsia IDL Overview by sriram_sun on Thursday March 17, 2022 @01:22PM (#30713587)
QNX is able to do this because QNX doesn't understand shared memory. Everything is a message/channel.