Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Medium-independent communication #737

Open
byorgey opened this issue Oct 8, 2022 · 4 comments
Open

Medium-independent communication #737

byorgey opened this issue Oct 8, 2022 · 4 comments
Labels
G-Design An issue having to do with game design. Z-Feature A new feature to be added to the game. Z-Research This issue requires inventing something new and/or studying research papers for clues.

Comments

@byorgey
Copy link
Member

byorgey commented Oct 8, 2022

Currently we have several vague ideas/starts towards communication of various kinds:

I'm wondering if we could somehow unify all these things so you could program communication protocols independently of the underlying transmission medium? I don't yet know what that would look like, but I was inspired thinking about @fryguybob 's comments re "modularity" in #218.

@byorgey byorgey added Z-Feature A new feature to be added to the game. G-Design An issue having to do with game design. Z-Research This issue requires inventing something new and/or studying research papers for clues. labels Oct 8, 2022
@xsebek
Copy link
Member

xsebek commented Oct 8, 2022

Heh, maybe we could add world: chan text, so that say == broadcast world. Basically the same thing as stdout in most programming languages.

To me channel is the most general idea and even physical wires (or in our case IO cables) are a kind of channel or communication medium.

@xsebek
Copy link
Member

xsebek commented Oct 8, 2022

I made a separate Issue for the cable communication, thanks for bringing it up! 👍

@byorgey
Copy link
Member Author

byorgey commented Oct 9, 2022

Yes, I love the idea of making chan the general underlying idea, and world : chan text.

@byorgey
Copy link
Member Author

byorgey commented Mar 27, 2023

In thinking this over, the big issue I keep coming back to is synchronization, especially when multiple readers and/or writers are involved. When you read from a channel, what do you get? Does a channel act like a queue, where it holds on to previous values? Or is it more like a broadcast mechanism?

  • If a channel is like a queue, such that sending over the channel enqueues a message and reading dequeues one, it makes asynchronous communication easy, since you can send whenever you like, and the intended recipient can come along and read whenever they like.
    • However, it means you can't really have multiple readers with one sender. You would have to simulate this by having e.g. have a single reader that passes along messages to multiple others.
  • On the other hand, a channel could just be a broadcast mechanism: if no one is listening at the time that you send a message, then the message is gone and no one can ever receive it.
    • This makes supporting multiple listeners trivial. However it makes asynchronous communication more difficult. You would have to e.g. create a dedicated listener robot to sit there listening all the time.

Edit: I think channels should probably just be a broadcast mechanism. That would be simpler and it's what cables/channels are really like. It also fits the aesthetic that we provide simple low-level mechanisms, and then you have to build more sophisticated/abstract things on top. See some additional relevant thoughts/comments here: #739 (comment) , in particular the idea to add an int parameter to the write or send command to determine how long to keep the value on the wire/channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
G-Design An issue having to do with game design. Z-Feature A new feature to be added to the game. Z-Research This issue requires inventing something new and/or studying research papers for clues.
Projects
None yet
Development

No branches or pull requests

2 participants