logoalt Hacker News

BoppreH • today at 3:15 PM • 2 replies • view on HN

A socket is just a raw byte stream. It's a solid base layer, but you'll have to implement your own communication protocol on top, and it'll require copying the data from one process to another. A "stream" is the wrong metaphor for local data sharing.

The data is already in memory and the source program knows its "shape"; there should be an easy mechanism to provide access to that by default, like /proc or gdb but for arbitrary data structures and with better UI.


Replies

cjfd • today at 4:33 PM

One idea would be that the data structures that a program uses declare if and how they want to be protected/accessed. E.g., access levels could be: only accessible in a local code block, only accessible in one thread, accessible by a limited number of threads, persistent or not between program runs, accessible over the network by certain machines/people, accessible to the whole world. A tree of all data in a program/computer could be exposed subjected to such access control. I would think that this does not even need to cost performance because 'only accessible in one thread' would not have to be implemented in a way that is different from current local/global variables.