Skip to content

move entire communication system into library #531

Closed

Description

@graydon

Ports, channels and tasks are going to sink into library features. This includes send and receive operators, as well as communication-alt expressions.

Activity

  1. eholk commented on Jun 21, 2011

    @eholk
    Contributor

    In a lot of ways, I like this. There's really little reason spawn shouldn't be in the library, as far as I know right now. One advantage is that it makes it easier to have different variants of spawn. We could have the simple version, and then other ones for "spawn in new thread" or "spawn on remote machine."

    One concern I'd have is that we might be giving up information that the compiler has about the semantics of communication, which could inhibit some of our optimization opportunities. Also, for the moment rust is doing a deep copy of data structures for spawn arguments and messages. This may not be something we actually need to do, but if we do need it, could we still do it nicely in a library?

  2. ghost assigned on Jun 21, 2011
  3. brson commented on Jul 25, 2011

    @brson
    Contributor

    I'm worried about communication alt being too verbose under this scheme. Also, can this be delayed until after the 0.1 milestone?

  4. graydon commented on Jul 25, 2011

    @graydon
    ContributorAuthor

    I think a couple simple schemes for comm-alt-via-a-library (say by tagging ports and channels you pass to the library call) will handle the verbosity. I'd prefer not to delay this; it really affects the feel of the language.

  5. eholk commented on Jul 25, 2011

    @eholk
    Contributor

    What do we have in mind for communication alt? Is it any different than this?

    alt(recv(p)) {
       ...
    }
    
  6. graydon commented on Jul 25, 2011

    @graydon
    ContributorAuthor

    no, that's just alt-ing on the result of a blocking receive. a comm-alt was to switch between "whichever of N communication events is ready next", a la a select loop. Which is fine: it just needs a richer function-call UI. There's lots of surface to possible event-waiting / event-notifying APIs though, which is exactly why I want it in a library, not a "ok let's do more compiler hacking to conduct the next experiment or tweak" situation.

  7. added a commit that references this issue on Apr 10, 2015
  8. added a commit that references this issue on Dec 12, 2017
  9. added a commit that references this issue on Jun 3, 2025
  10. added a commit that references this issue on Jun 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsA-type-systemArea: Type system

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions