[rust-dev] RFC: New Rust channel proposal

Jason Fager jfager at gmail.com
Fri Jan 24 05:44:16 PST 2014


Consider my +1 for Source/Sink more as a -1 for Port/Chan.  I don't really
care what it ends up as so long as I don't have to look up which is which
every time.  Sender/Receiver wfm.

As far as concerns about the proposal itself, my only remaining issue is
that Chan isn't a trait and so the actual chan type you use can't be
arbitrarily swapped without changes throughout a code base.  The morphing
channel partially addresses this, but doesn't really accommodate things
like wrapped channels or switching to the unbounded or bounded
alternatives.  I understand there are drawbacks to making it a trait,
though, so this isn't a counter proposal, just a lament.



On Thursday, January 23, 2014, Benjamin Striegel <ben.striegel at gmail.com>
wrote:

> If we're going to quibble over names we might as well call the types
> Sender and Receiver.
>
> Really though, EVERYONE is fine with the proposed semantics from the
> original thread? Really? Speak up if you have anything valuable to add that
> isn't bikeshedding! :)
>
>
> On Thu, Jan 23, 2014 at 11:13 PM, don <donquestion at rocketmail.com<javascript:_e({}, 'cvml', 'donquestion at rocketmail.com');>
> > wrote:
>
>> Hi, as a not contributing listen-in,
>>
>> i would like to voice that source and sink share the same initial and
>> therefore source and drain might be more useful.
>>
>> I hope i didn't offend by voicing my opinion,
>> keep up the good work!
>>
>> Regards Don
>>
>>
>> Am 24.01.2014 04:54, schrieb Brandon Sanderson:
>>
>>> I would expect Channel::new() to create a channel object that either
>>> lets me send and receive, or lets me get a source and sink to send and
>>> receive with.  Borrow rules may prevent this, but my point is that
>>> Channel::new() would generally be expected to return a struct, and not a
>>> tuple.
>>>
>>> On Jan 23, 2014 7:29 PM, "Benjamin Striegel" <ben.striegel at gmail.com<javascript:_e({}, 'cvml', 'ben.striegel at gmail.com');>
>>> <mailto:ben.striegel at gmail.com <javascript:_e({}, 'cvml',
>>> 'ben.striegel at gmail.com');>>> wrote:
>>>
>>>     This all seems a bit silly. A channel *is*, conceptually, a tuple of
>>>     a sender and a receiver. If I call Chan::new(), that's what I expect
>>>     to get. And Chan::open() doesn't map to anything that's as intuitive.
>>>
>>>     Is naming really all that's left to argue about? How does everyone
>>>     feel about the semantics of the proposal?
>>>
>>>
>>>     On Thu, Jan 23, 2014 at 10:20 PM, Strahinja Markovic
>>>     <val at markovic.io <javascript:_e({}, 'cvml', 'val at markovic.io');><mailto:
>>> val at markovic.io <javascript:_e({}, 'cvml', 'val at markovic.io');>>> wrote:
>>>
>>>
>>>         On Thu Jan 23 2014 at 7:18:11 PM, Tony Arcieri
>>>         <bascule at gmail.com <javascript:_e({}, 'cvml',
>>> 'bascule at gmail.com');> <mailto:bascule at gmail.com <javascript:_e({},
>>> 'cvml', 'bascule at gmail.com');>>> wrote:
>>>
>>>             I have a crazy idea...
>>>
>>>             Channel::open()
>>>
>>>
>>>         That's a better name for the function, agreed.
>>>
>>>
>>>             https://lh3.ggpht.com/-WpuYGqCEHDg/UBznzaqReKI/
>>> AAAAAAAAB_0/0Vc8_mnnhqw/s1600/mind-blown.gif
>>>
>>>             --
>>>             Tony Arcieri
>>>
>>>
>>>         _______________________________________________
>>>         Rust-dev mailing list
>>>         Rust-dev at mozilla.org <javascript:_e({}, 'cvml',
>>> 'Rust-dev at mozilla.org');> <mailto:Rust-dev at mozilla.org<javascript:_e({}, 'cvml', 'Rust-dev at mozilla.org');>
>>> >
>>>
>>>         https://mail.mozilla.org/listinfo/rust-dev
>>>
>>>
>>>
>>>     _______________________________________________
>>>     Rust-dev mailing list
>>>     Rust-dev at mozilla.org <javascript:_e({}, 'cvml',
>>> 'Rust-dev at mozilla.org');> <mailto:Rust-dev at mozilla.org<javascript:_e({}, 'cvml', 'Rust-dev at mozilla.org');>
>>> >
>>>
>>>     https://mail.mozilla.org/listinfo/rust-dev
>>>
>>>
>>>
>>> _______________________________________________
>>> Rust-dev mailing list
>>> Rust-dev at mozilla.org <javascript:_e({}, 'cvml',
>>> 'Rust-dev at mozilla.org');>
>>> https://mail.mozilla.org/listinfo/rust-dev
>>>
>>>  _______________________________________________
>> Rust-dev mailing list
>> Rust-dev at mozilla.org <javascript:_e({}, 'cvml', 'Rust-dev at mozilla.org');>
>> https://mail.mozilla.org/listinfo/rust-dev
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140124/7ddf3ef7/attachment.html>


More information about the Rust-dev mailing list