4 ms·
"I could use Rust, but a glance at the concurrency documentation looks like I’ll be spending a lot of my time doing exactly the kind of thread management refere
by krenoten 12y ago
"I could use Rust, but a glance at the concurrency documentation looks like I’ll be spending a lot of my time doing exactly the kind of thread management reference counting minutiae that Go does for me by providing channels."
Actually, rust does provide very similar concurrency primatives. T̶h̶i̶s̶ ̶i̶s̶ ̶a̶ ̶s̶h̶o̶r̶t̶ ̶i̶n̶t̶r̶o̶d̶u̶c̶t̶i̶o̶n̶,̶ ̶a̶l̶t̶h̶o̶u̶g̶h̶ ̶I̶ ̶d̶o̶n̶'̶t̶ ̶t̶h̶i̶n̶k̶ ̶i̶t̶ ̶w̶i̶l̶l̶ ̶c̶o̶m̶p̶i̶l̶e̶ ̶o̶n̶ ̶t̶h̶e̶ ̶a̶l̶p̶h̶a̶ ̶d̶u̶e̶ ̶t̶o̶ ̶t̶h̶e̶ ̶u̶s̶e̶ ̶o̶f̶ ̶p̶r̶o̶c̶:̶ ̶h̶t̶t̶p̶:̶/̶/̶w̶w̶w̶.̶r̶u̶s̶t̶f̶o̶r̶r̶u̶b̶y̶i̶s̶t̶s̶.̶c̶o̶m̶/̶b̶o̶o̶k̶/̶c̶h̶a̶p̶t̶e̶r̶-̶0̶6̶.̶h̶t̶m̶l̶. See Steve's awesome documentation posted below!
Currently you need to type a bit more, but the compiler is able to make some channel usage errors uncompilable. I can see myself doing napkin prototyping in Go (as I already do) and writing the real version in Rust for better performance and safety in many cases.
- steveklabnik 12y agoThe official docs are pretty reasonable here: http://doc.rust-lang.org/std/sync/mpsc/index.html http://doc.rust-lang.org/std/sync/mpsc/index.html