News for hackers. Stuff that matters.
Re:Learning Rust by mattdw on Sunday November 02, 2014 @05:23PM (#8548327)
I assume coroutines could be trivially implemented with sync_channel(0), which blocks the sender until the receiver takes the message. (And the receiver blocks until there is a message available.)

The 'generator' use of coroutines could be implemented with Receiver::iter, which is an iterator over a channel.

(As I understand it, coroutines are just a special case of channels.)

[Edit: see <http://doc.rust-lang.org/std/comm/> for channel docs]

Re:Learning Rust by amelius on Monday November 03, 2014 @07:15AM (#8550405)
Wouldn't that require the use of threads, and hence be very expensive?
Re:Learning Rust by ufo on Sunday November 02, 2014 @10:47PM (#8549256)
Your link is broken - there is an extra ">" at the end.