Cat by C418 is literally the only piece in the list I recognize.
Cat by C418 is literally the only piece in the list I recognize.
I am also very interested in seeing what the next generation of Rust-inspired languages will look like, and not because I am dissatisfied with Rust today. Rust has significantly raised the bar of how a good programming needs to work and any new language in the systems programming area (and beyond) will inevitably be compared to it.
Being active is probably most important.
Maybe it would be possible to get a link into a “This Week in Rust”?
I use Colemak where most punctuation is at the same place as in the US English layout, which programming languages seem to be optimized toward. For the layout I prefer ISO for the larger Enter key.
Rust:
Cannot move princess out of
castle
which is behind a shared reference
You’re trying to iterate over a Vec while mutating its contents in other places, which is something the borrow checker doesn’t like. Altough the later cards that get their copies count increased aren’t the same as the iterating reference card
, Rust forbids two mutable references into the same Vec, even if they reference different elements of the Vec.
You could try to iterate over indices into the array instead of directly over array elements, then you get rid of the reference in the outer loop. This would probably require the least change to your code.
Another option would be to split apart the data structures between what needs to be mutated and what doesn’t. I’ve solved this puzzle in Rust and had a separate mutable Vec for the number of copies of each card. Then you can iterate over and mutate both Vecs separately without having conflicting references.
That was quite the rabbit hole, and know I know that my CPU has a bug. Great.
I want to make a joke about how terrible the name is with just throwing in an ‘a’, but I don’t think it would be right since I’m using Fira Code.
Is that in reference to the Safety Third podcast?
Great to see the Servo project getting more support. Having more choice in this space is a very good thing. Igalia keeps doing fantastic work.
I’m using it and it does feel faster, but I haven’t done real benchmarks yet. But it’s easy enough to set up, so might as well try it out.
I don’t think there is a good way of having references within the same struct, but you could store reference counted matches:
matches: Vec<Rc<Match>>, players: HashMap<String, Rc<Match>>,
You would still have to make sure that the
players
map is updated, maybe weak references are useful there.Maybe you could also consider storing the players of a match in the match itself, not outside.