Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ha! Bummer, maybe I will just need to re-write this paragraph.

A RWArc is shared mutable state: you can have two references to the Arc in two different tasks. Yet I said that Rust throws a compiler error for shared mutable state.

> (at first I thought it was implemented in C/C++).

There's very little C++ in Rust anymore. :)

> Seems easy, one needs a "backdoor" to implement RWArc in Rust

Yup, this is exactly the point with those two sentences. Maybe I should just straight-up remove them.



> There's very little C++ in Rust anymore.

I think we've now got none, except for LLVM in the compiler, which means any binaries built using the stdlib don't need any C++ libraries (to be clear, libraries without the stdlib have never needed any).


> Maybe I should just straight-up remove them.

Or be explicit that you'll now talk about RWArc implementation.


Yes. This.

I found it a bit worrying, as when I read that I had to go back and re-read the code a few times to make sure that there wasn't an unsafe block in the code, or perhaps that the use of RWArc implied unsafe, and would then turn that whole function into an automatically unsafe block.

Nevertheless, very cool. I really liked the tutorial, I'm getting quite excited by Rust.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: