Finished both “Learning Go” and “The Rust Programming Language” today (latter of which has taken over a year, admittedly). Not sure I’m likely to be doing much Rust in the foreseeable future, but it’s been an interesting perspective — some things in Go have made more sense through learning how Rust does it too. (Like concurrency: “use message passing not shared memory” versus “here’s how rust makes shared memory safer”.)

#GoLang #RustLang

Reply to this note

Please Login to reply.

Discussion

nostr:npub1jx3dzll682rmfgzla5wwyjjsk5f05eml4845nrxvww3ulnt3shxqq0m6x6 Rust offers both, channels and locking with a Mutex or RwLock. There also more flexible channels in crossbeam:

https://github.com/crossbeam-rs/crossbeam

It doesn't force you to use the easier and less error prone channels, but it also makes sharing memory much easier. It is proven that data races are not possible in Rust. On the other hand, Go knows about the problem and tell you to run a program with an optin tool as long until a data race is detected (if it was reached):

https://go.dev/doc/articles/race_detector