this post was submitted on 30 Dec 2024
-2 points (47.1% liked)
Rust
6175 readers
30 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
That's true for your application maybe, but they go on to say how one should consider whether or not their problem is going to fit well within the rules of the rust borrow checker and that needs to be talked about more (vs just assuming Rust is the safest option).
I'm going to agree to disagree with you there. I'd throw this in the category of persistent myth. Yes, ideally, you learn from your first experience and make everything better, but the reality is you often just end up with different mistakes.
Rewrites aren't often done outside of hobbyish projects because they're very expensive, stop new feature development, and you really can end up with something that's worse than what you started with (this is especially true if you've switched languages or frameworks).
They do explain ~~with citations~~ why it makes more sense (i.e. you end up with something more performance) to write their VM outside of the restrictions of the borrow checker.
I think the claim is a bit of a stretch off the cuff. Ideally to retort this some rustacian would implement a mark and sweep VM in Rust with maximal use of the borrow checker.
Edit: Looking at their code, it's not all just one big unsafe block either. But it is something that they frequently had to drop down to, to implement this particular garbage collection strategy.
Yeah, that is why I was calling out their title as click bait. Saying Rust vs Zig will mean most people think of safe rust vs zig. But the article is about unsafe rust vs zig which is a completely different story IMO. If you need lots of unsafe zig might be better - but the title does not say that. Hence IMO it is clickbaity.
Ok I will give you that for big projects. But this is on the other side of that. If you write two things in quick succession you will more likely still have the problems encountered in mind and be better able to navigate them the second time than if you are part of a large team that has had a lot of turn over since the project was first written. And you might make different mistakes - but the second round of mistakes is normally less impactful then the first set.
Oh yeah, of course this case I can see all that being true. But fundamentally they chose this problem because of that given they said:
Sounds like they want to compare unsafe rust with zig. They started with that idea which from my experience is not typical of most applications so their findings are not either.
Yeah that one might be.
Though unsafe rust overall is not a large amount of what rust code is, the author does seem to be picking the topic based on the hardest parts of rust and their title talks about all of rust which IMO is an unfair comparison. The story of zig being better than unsafe rust is interesting but only part of the whole zig vs rust debate.