News for hackers. Stuff that matters.
Re:Bugs that the Rust compiler catches for you by lordnacho on Thursday May 05, 2022 @06:08PM (#31278905)
All really good things to mention, but the data races thing is a big deal and gets just a short reference and where is the bit about the borrow checker?

The way I see it the things mentioned are nice appetizers and the data race and borrow checker are the main meal.

IME the most frustrating problems are not that you forgot to exhaust the switch statement or didn't initialise a new field, it's when you get a segfault that's hard to reproduce and you have barely a hint about what's caused it.

Re:Bugs that the Rust compiler catches for you by infogulch on Thursday May 05, 2022 @07:49PM (#31279562)
For my first C class in uni I wrote a curses-style CLI spreadsheet tool with a csv parser, reverse cell reference table, automatic modification-based recursive recalculation, a basic formula parser, an infix notation to reverse polish notation "compiler", and a stack-based RPN evaluator (I may have gone a bit overboard on that assignment). The one multi-user unix server for all students that I wrote it on (named 'foley', some CS reference I think) had an ancient gcc compiler that compiled it just fine, but when run it would segfault. Hardly surprising, I created hundreds of segfaults, but this one would only segfault if I used -O0 and didn't add any logging statements. That's right, it ran fine with any level of optimization above 0 or if I used any logging statements, and only segfaulted on -O0. Utterly infuriating and flagrantly defied my expectations. I got help from some patient soul I found on freenode ##c (I wish I could remember their name) who didn't see any obvious issue or warning and couldn't reproduce any segfault with their much more recent compiler. -Wall+++, asan, nothing cracked it. Everything else was exhausted: it must be the compiler. But I couldn't just update the compiler package because it was a multi-user server and I had zero permissions, so I ended up bootstrapping a 10-years newer gcc through multiple intermediate versions and installing it in my profile (quotas be damned) and used that. It didn't segfault on -O0 anymore. I haven't voluntarily used C since.
Re:Bugs that the Rust compiler catches for you by andrewchambers on Thursday May 05, 2022 @08:58PM (#31280010)
This is not a good anecdote - You hit a 10 year old bug because your sysadmin was too lazy to update gcc and then formed a bad impression of the software?

Guess what, if you install a 10 year old version rust none of your code would not compile at all. Your logic is so flawed its hard to believe you are being serious. If anything it's impressive that a 10 year old C compiler worked most of the time when most other languages are not stable on these timescales.

Re:Bugs that the Rust compiler catches for you by duckerude on Friday May 06, 2022 @04:05AM (#31282616)
The oldest rustc version I target (for a tiny project, admittedly) is over 6 years old, and it's fine. When code works it also works on the latest release. When code doesn't work I get a reasonable compile-time error message, not a mysterious segfault at runtime.

It's not easy, even in a few hundred lines I had to remove many conveniences to go that far back, but it's very legible. The compiler has my back, I'm never confused about whose fault it is.

Rust is young, but I don't expect this to be any different in 2030.

Re:Bugs that the Rust compiler catches for you by avgcorrection on Friday May 06, 2022 @05:57AM (#31283340)
> Guess what, if you install a 10 year old version rust none of your code would not compile at all.

Rust was not stable in 2012 yet.

I do agree with your overall point though.

Re:Bugs that the Rust compiler catches for you by kragen on Thursday May 05, 2022 @07:55PM (#31279592)
That's not related to C, except in the sense that GCC is written in C. GCC was just emitting incorrect code because it had a bug in its code generator. If there's a bug in the LLVM code generator (which is written in C++), rustc might end up doing the same thing.

If you write the compiler in Rust it could still happen. Rust code (that compiles) has less bugs than the corresponding C but not zero bugs.

It doesn't sound like you went overboard, it sounds like a good project. Maybe you should have written it in Perl 5.001 though.

Re:Bugs that the Rust compiler catches for you by infogulch on Thursday May 05, 2022 @08:04PM (#31279642)
Because it was C I couldn't be sure it was the compiler's fault until I really exhausted every other option. Maybe spent 100h between a few people getting to the end of it. If I had written in safe Rust (I would have, I wasn't doing anything weird) and it segfaulted I'd know immediately that the compiler was the problem because you can't make safe rust segfault.
Re:Bugs that the Rust compiler catches for you by kragen on Thursday May 05, 2022 @08:06PM (#31279662)
Yes, that's true.
Re:Bugs that the Rust compiler catches for you by andrewchambers on Thursday May 05, 2022 @09:31PM (#31280211)
Or he could do the normal thing and run valgrind to instantly see exactly where the problem is. I don't even disagree with the premise, but these are straw man arguments.
Re:Bugs that the Rust compiler catches for you by kragen on Thursday May 05, 2022 @09:37PM (#31280242)
Valgrind didn't exist then. (Next you're going to say ASan and UBSan. Those didn't exist either.) They (he?) could have run GDB and disassembled the code around the crashing instruction and verified that the machine code there didn't make any fucking sense. But that implies they knew assembly language well enough to recognize when their compiler was spewing nonsense, which is a couple of steps above "can read working assembly emitted by the compiler" or even "can write applications in assembly language".

Even with Valgrind it can be tough to distinguish whether your output code is wrong because of a bug in the compiler or because your code was just wrong. There was a change to GCC a few years back that introduced security holes into the FreeBSD and NetBSD kernel because it just threw away code that would only be invoked in "undefined behavior" scenarios. Signed integer overflow I think.

Re:Bugs that the Rust compiler catches for you by andrewchambers on Thursday May 05, 2022 @09:43PM (#31280288)
You are unfairly comparing ancient C with modern rust - Try comparing modern C with modern rust to avoid making a straw man argument. Like I said, I don't even disagree, I still think you are just doing everyone a disservice with this line of reasoning.

He said if he had used rust - I am saying if he had used C when rust was available 1. The bug would have been fixed. 2. He could have used valgrind. Modern C also has something called ubsan, and another thing called frama-C.

These tools may be inferior to what rust has, but ignoring they exist or comparing 10+ year old C with modern rust is a bad faith argument.

Re:Bugs that the Rust compiler catches for you by kragen on Thursday May 05, 2022 @10:51PM (#31280753)
I agree, I don't think that a bug in GCC last millennium is a very strong argument for using Rust instead of C today, though such arguments do exist.

However, I also don't think they particularly help you to distinguish a compiler bug from an error in your understanding of the language semantics, although they sure do help a lot with everyday errors.

With respect to questions of inferiority or superiority, keep in mind that Valgrind and UBSan are only dynamic checkers; they don't help at all with errors that don't occur in your testing. Frama-C is a static checker more similar to Rust's capabilities, but much more limited, but also with cscope-like abilities for reverse-engineering existing source bases.

The great advantage these three tools (and ASan) have is that you don't have to rewrite your C in Rust in order to use them.

Re:Bugs that the Rust compiler catches for you by KsassPeuk on Wednesday May 11, 2022 @10:04AM (#31340092)
> but much more limited

I agree and I disagree ;)

I agree because having a type system that directly provides the guarantee that whole classes of runtime error cannot happen provides fast feedback during development at a low cost.

I disagree because even in a press button (+ tuning) approach, you can prove things with Frama-C that the Rust compiler cannot prove (reason why there is runtime bound-checking, implementation defined behavior for integer overflow and so on in Rust). But also because you can prove much more advance properties than "just" absence of runtime errors.

Re:Bugs that the Rust compiler catches for you by kragen on Friday May 13, 2022 @08:52PM (#31374091)
And vice versa; Frama-C doesn't attempt to prove the absence of data races, last I checked.
Re:Bugs that the Rust compiler catches for you by KsassPeuk on Monday May 16, 2022 @03:20AM (#31394360)
In fact there exists a plugin that can do that but it is currently not free:

https://frama-c.com/fc-plugins/mthread.html

(And by the way since it is not done by typing it is hard to use on legacy code)

Re:Bugs that the Rust compiler catches for you by jcelerier on Friday May 06, 2022 @02:58AM (#31282133)
OP mentions asan so valgrind definitely did exist - it's more than twice as old as asan
Re:Bugs that the Rust compiler catches for you by kragen on Friday May 06, 2022 @09:05AM (#31284637)
Hmm, that's interesting—that seems like an inconsistency in the story. OP, what year was this?
Re:Bugs that the Rust compiler catches for you by jcelerier on Friday May 06, 2022 @01:40PM (#31287864)
I don't see any inconsistency. Universities still have multi-user unix servers for students in 2022 - at Bordeaux there's a few 64/128 thread ones with as many gigabytes of RAM, which leaves a lot of room for doing work during class. (And most likely they would be running some Debian LTS like Jessie or Stretch)
Re:Bugs that the Rust compiler catches for you by kragen on Friday May 06, 2022 @01:42PM (#31287887)
Sure, I'm using a multi-user Unix server right now in another window. The key point was that there was just one server for all the undergraduates. (And that they had to worry about a private install of GCC using up their disk quota.)
Re:Bugs that the Rust compiler catches for you by jcelerier on Friday May 06, 2022 @02:56PM (#31288589)
.. the uni I'm involved in still has a 1gb quota per student ~ afaik which ... needs some contorsion to be able to fit a GCC build, for sure
Re:Bugs that the Rust compiler catches for you by kragen on Saturday May 07, 2022 @01:43PM (#31296772)
Yeah, you can't build modern GCC inside the 1GB quota, but you can probably build it in /tmp or /var/tmp or /scratch or something. The actual built compiler is under 50 MB in GCC 8. And if you're really cramped on quota you can gzexe it, at the cost of painfully slow startup times.
Re:Bugs that the Rust compiler catches for you by pjmlp on Friday May 06, 2022 @06:41AM (#31283618)
I am quite sure stuff like Insure++ and Purify did exist.
Re:Bugs that the Rust compiler catches for you by kragen on Friday May 06, 2022 @09:04AM (#31284630)
Yes, Purify surely existed. I've never heard of a university leasing out Purify licenses to undergrads. I don't know anything about Insure++.
Re:Bugs that the Rust compiler catches for you by pjmlp on Friday May 06, 2022 @09:35AM (#31284894)
On my days that kind of software was accessible in all universities, with the right connections.
Re:Bugs that the Rust compiler catches for you by shaklee3 on Friday May 06, 2022 @09:14AM (#31284715)
valgrind came out 20 years ago, so yes, it definitely existed 10 years ago.
Re:Bugs that the Rust compiler catches for you by kragen on Friday May 06, 2022 @09:33AM (#31284876)
20 years ago nearly all universities could afford more than a single Unix box for all the undergraduates to share. At that point it was mainstream to buy a cheap US$300 ATX box and run Linux on it, so you could have one per student or one per dozen students, rather than one for the whole undergraduate student body.

The Rio Receiver came out 21 years ago. That was a Linux box sold as a consumer electronics stereo component; it grabbed MP3s over Ethernet to play them. I don't remember how much it cost but it was less than US$300.

But apparently the original author tried using asan? That seems like an inconsistency in the story.

Re:Bugs that the Rust compiler catches for you by kaba0 on Friday May 06, 2022 @05:35AM (#31283187)
Valgrind only outputs errors on codepaths that got run. Which sure, if it is a deterministic segfault it would catch, but let’s say you have a race condition and only get segfault 1 times out of 100, and it may not even happen on valgrind?
Re:Bugs that the Rust compiler catches for you by kragen on Friday May 06, 2022 @10:25AM (#31285488)
Right, but it is pretty great for deterministic segfaults.
Re:Bugs that the Rust compiler catches for you by infogulch on Thursday May 05, 2022 @08:44PM (#31279906)
Yes perl may have been a better choice for the projects sake, but alas the course was apparently a trial-by-~fire~segfault of C + string processing. Loved PCRE though... hmm I wonder if you could do it with just a regex...
Re:Bugs that the Rust compiler catches for you by kragen on Thursday May 05, 2022 @08:57PM (#31280004)
I will be very surprised if you can write a working spreadsheet in a PCRE regex. Perl itself permits you to embed arbitrary Perl code in a "regex", though.
Re:Bugs that the Rust compiler catches for you by pjmlp on Friday May 06, 2022 @01:46AM (#31281708)
GCC is being written in C++ for about a decade now.
Re:Bugs that the Rust compiler catches for you by charcircuit on Thursday May 05, 2022 @07:57PM (#31279600)
GCC is written in C++
Re:Bugs that the Rust compiler catches for you by kragen on Thursday May 05, 2022 @08:03PM (#31279637)
There are small parts of GCC that are written in C++, but at the time when universities had "one multi-user unix server for all students" it was 100% C.
Re:Bugs that the Rust compiler catches for you by pjmlp on Friday May 06, 2022 @01:55AM (#31281756)
Yeah, but that was 40 years ago, back when GCC still stood for GNU C Compiler.
Re:Bugs that the Rust compiler catches for you by kragen on Friday May 06, 2022 @09:08AM (#31284662)
I had pegged it as between 20 and 30 years ago, but someone pointed out that the author said they tried using asan. 40 years ago most universities didn't have Unix boxes accessible to random undergraduates at all.

GCC started having parts written in C++ 12 years ago: https://lwn.net/Articles/542457/

Re:Bugs that the Rust compiler catches for you by turminal on Thursday May 05, 2022 @08:18PM (#31279728)
and there was no LLVM :)
Re:Bugs that the Rust compiler catches for you by kragen on Thursday May 05, 2022 @08:20PM (#31279746)
Nor Rust!
Re:Bugs that the Rust compiler catches for you by tylerhou on Thursday May 05, 2022 @06:34PM (#31279120)
In addition, most of these checks are provided in other languages or linters for those languages. E.g. C++ has had RAII before Rust has existed. C++ (with -Werror), TypeScript and most FP languages have exhaustive switch checking. Clang can catch many (but not all) initialization errors. The places where Rust adds value (data races, memory safety, explicit unsafe) are not discussed in the article.
Re:Bugs that the Rust compiler catches for you by nicoburns on Thursday May 05, 2022 @08:23PM (#31279758)
Rust also adds value in providing so many of th checks where most languages only have a subset, and being incredibly consistent in having safe defaults.
Re:Bugs that the Rust compiler catches for you by tylerhou on Thursday May 05, 2022 @10:03PM (#31280427)
Not untrue, but the post doesn’t mention prior work, so it’s implying that Rust is one of the only languages that has these features, whereas even C++ (notorious for being unsafe) as a majority of the features (in Clang). Clang can even catch many data race issues with the proper annotations. Maybe it’s ignorance, but given how posts proselytizing Rust tend to get popular on HN, it makes me suspicious that the omission was intentional.
Re:Bugs that the Rust compiler catches for you by sgift on Friday May 06, 2022 @06:39AM (#31283602)
> In addition, most of these checks are provided in other languages or linters for those languages.

Linters are inferior to things the compiler catches for the same reason test cases are inferior: They are not enforced. If the compiler doesn't allow something you can say with confidence you will never see it in the wild. With linters, compiler switches (-Werror) or test cases you'll have no idea.

Re:Bugs that the Rust compiler catches for you by SemanticStrengh on Thursday May 05, 2022 @08:04PM (#31279645)
I would like to see more about atypical language protections. GCC has many underknown flags that protects against very specific things. Kotlin is the first popular language to support structured concurrency, eliminating many classes of concurrency errors. It's basically "RAII" for threads, coroutines.

Tailrecursive and deeprecursive allow for making any recursive function stack-overflow safe.

Re:Bugs that the Rust compiler catches for you by pjmlp on Friday May 06, 2022 @01:45AM (#31281702)
I guess C# isn't popular.
Re:Bugs that the Rust compiler catches for you by SemanticStrengh on Friday May 06, 2022 @10:04AM (#31285241)
It is of course but I doubt C# has structured concurrency?
Re:Bugs that the Rust compiler catches for you by eptcyka on Thursday May 05, 2022 @06:16PM (#31278979)
I've seen people who state their love for Rust and then fail to explain the difference between passing an argument by value, reference or mutable reference.
Re:Bugs that the Rust compiler catches for you by carlmr on Thursday May 05, 2022 @06:47PM (#31279232)
I mean those are two separate things. Depending on how you code, Rust can be similarly high level as Python, make it much easier to design with types than C++ and has great package management with cargo.

You can find plenty of reasons to love Rust, without even getting to the technical details.

Re:Bugs that the Rust compiler catches for you by Thaxll on Thursday May 05, 2022 @07:11PM (#31279377)
> Rust can be similarly high level as Python

Not really, once you start something more complicated than hello world and start to try mutate things for example it get 100x more complicated that Python.

Re:Bugs that the Rust compiler catches for you by mamcx on Thursday May 05, 2022 @10:17PM (#31280516)
> Rust can be similarly high level as Python

In fact, Rust is MORE high level than python and most languages. That is exactly the borrow checker and all the other things are.

What is not, is being "simple" as python.

I code now full Rust and is the most productive language in my +20 years of this. My other picks: python, Delphi, FoxPro.

But is not productive exactly the same way python/delphi is. It has other axes of it. So in some task Python is unmatched and my main pick for scripting or brainstorming stuff. But Rust is the best at being overall productive.

Where is not (today) is lack of time/resources to be there (like GUIs. But honestly, nothing compare to FoxPro/delphi)...

Re:Bugs that the Rust compiler catches for you by girvo on Friday May 06, 2022 @12:45AM (#31281408)
> nothing compare to FoxPro/delphi

Amen. Every so often I boot up Lazarus and lament what could have been. Even the best web-dev frontend tools and frameworks do not come close.

I wonder if there is even a market for those sorts of tools today, though. I wasn't there for the decline of Delphi (and FoxPro, et al), so I've no real reference as to why they declined.

Re:Bugs that the Rust compiler catches for you by pjmlp on Friday May 06, 2022 @01:59AM (#31281775)
Qt, WPF, OutSystems,...

The tools are out there, even Delphi is still being sold and having a yearly conference in Germany.

They declined because only developers working at Fortune 500's get to pay for software.

When one only wants to have free beer, they get to have what the street bazaars can offer, instead of what the monks are using at the cathedral.

Re:Bugs that the Rust compiler catches for you by mamcx on Friday May 06, 2022 @01:58AM (#31281764)
I think all the stuff about nocode/lowcode/jupyter/etc say exist the market, but is going in a overly weird route, as if nobody know what this tools can do.

My dream is rebuild it: https://tablam.org!

Re:Bugs that the Rust compiler catches for you by kaba0 on Friday May 06, 2022 @05:43AM (#31283240)
No, this low-high level axis is not really “permeable”. You can maybe get as productive in rust as in some managed language at the first time you write the program. But later maintenance will simply drop your productivity as any refactor will likely alter your whole memory/ownership model and cause much more refactor recursively. Sure, you may say that “but it will be correct in the end while in python you have to hunt down the newly created bugs” and you might be right, but it is not a small price to pay. Managed languages let you get away with many many unanswered questions that you have to meticulously answer in case of low level ones, and I think it is a fair tradeoff depending on use-case. But as much as I love Rust, I won’t choose it for some database-mangling web service.
Re:Bugs that the Rust compiler catches for you by mamcx on Friday May 06, 2022 @05:02PM (#31289583)
> But later maintenance will simply drop your productivity as any refactor

This is very off weird take: Refactoring in Rust is one of their strengths as language (a major one!) where even VERY deep changes can be done in economical times.

Try the same in python is nearly impossible.

And I mean it: I fully rewritten all my app (a fairly complex niche eCommerce platform) to async and remade all things along it.

And I have A LOT of experience building, rewriting, and porting code; and Rust is the faster/more friendly to refactor both large or small in all my years.

However, I concede that get the knowledge with Rust have challenges and my first attempts at this (when doing my hobby https://tablam.org language) were miserable by lack of understanding, so it could be a factor.

Re:Bugs that the Rust compiler catches for you by DeathArrow on Friday May 06, 2022 @11:07AM (#31286049)
That's a valid criticism. While I can be much more productive in .NET with the help of the language, the compiler, the IDE, intellisense and copilot, looking at last Techempower benchmarks, Rust is still 1.6 faster.

I would use Rust for Web if I'd have to squeeze every bit of performance. Most of the of the time I don't have such need for performance.

Re:Bugs that the Rust compiler catches for you by DeathArrow on Friday May 06, 2022 @10:12AM (#31285321)
>Where is not (today) is lack of time/resources to be there (like GUIs. But honestly, nothing compare to FoxPro/delphi)

A few that come to my mind: C++ Builder, QT, Windows Forms, Xamarin, .NET MAUI.

Re:Bugs that the Rust compiler catches for you by ZephyrBlu on Thursday May 05, 2022 @07:57PM (#31279602)
I recently ported some Python to Rust and I actually did feel like a lot of the Rust code was pretty similar to Python.

Mutating things is mostly not that difficult, just add mut to the declaration and then &mut if you pass it around.

The most difficult thing was lifetimes.

E: borrows got a little tricky as well

Re:Bugs that the Rust compiler catches for you by carlmr on Friday May 06, 2022 @03:22AM (#31282321)
This is what I mean, I ported some Python code almost 1:1.

If you program in a functional way anyway, i.e. having data go through a series of filters, it is quite easy. But not all ways of programming are so easy to port to Rust.

Re:Bugs that the Rust compiler catches for you by melissalobos on Thursday May 05, 2022 @07:19PM (#31279423)
> start to try mutate things for example it get 100x more complicated that Python.

I don't know about 100x, using Box and mutexes it is pretty much as complicated or maybe 2x. If you want it to be efficient and leverage all of Rust then sure, but that wasn't what they were meaning.

Re:Bugs that the Rust compiler catches for you by Thaxll on Thursday May 05, 2022 @07:20PM (#31279432)
I don't see where in Rust you could have code that looks high level as in Python.
Re:Bugs that the Rust compiler catches for you by steveklabnik on Thursday May 05, 2022 @07:54PM (#31279588)
I did a random little comparison a while back https://news.ycombinator.com/item?id=22712441

One tiny program does not a realistic comparison make, of course. There’s tons of situations where either language can make things more complex than this example. But for basic tasks it’s not particularly complicated.

Re:Bugs that the Rust compiler catches for you by melissalobos on Thursday May 05, 2022 @07:22PM (#31279448)
https://actix.rs/

Look at the first example. It can be very similar.

Re:Bugs that the Rust compiler catches for you by jay_kyburz on Thursday May 05, 2022 @07:39PM (#31279523)
Haha, I think you might need to have another look at Python.
Re:Bugs that the Rust compiler catches for you by gpm on Thursday May 05, 2022 @08:23PM (#31279759)
Note that their example is something like making a hello world web server using twisted (or whatever the current async framework is) in python...

Strange example, but I suppose making the corresponding python more complex is one way to make them equivalent.

Re:Bugs that the Rust compiler catches for you by code_biologist on Thursday May 05, 2022 @08:54PM (#31279973)
For reference I'd say the "current async framework" is either Starlette [1] (low level) or FastAPI [2] (high level) for web stuff, and trio [3] for more stupidproof general async than twisted. IMHO of course!

[1] https://www.starlette.io/ [2] https://fastapi.tiangolo.com/ [3] https://trio.readthedocs.io/en/stable/

Re:Bugs that the Rust compiler catches for you by gpm on Thursday May 05, 2022 @08:56PM (#31279988)
Thanks, I appreciate it :)
Re:Bugs that the Rust compiler catches for you by DeathArrow on Friday May 06, 2022 @10:15AM (#31285378)
> Rust can be similarly high level as Python

What about Haskell? Can it be similarly high level as Haskell?

Re:Bugs that the Rust compiler catches for you by dsQTbR7Y5mRHnZv on Friday May 06, 2022 @08:46PM (#31291149)
This may be the closest thing I've personally seen: https://github.com/timvisee/advent-of-code-2021
Re:Bugs that the Rust compiler catches for you by ben0x539 on Thursday May 05, 2022 @07:57PM (#31279604)
people are allowed to love things without being experts or even particularly didactic about it lmao
Re:Bugs that the Rust compiler catches for you by eptcyka on Friday May 06, 2022 @12:46PM (#31287264)
I'm not sour about people enjoying things. Would you not feel peculiar about people who are really enthusiastic about a sous vide machine and use it to heat water for their tea? And when asked about their favourite cut of steak they like to sous vide, they'd stare blankly and proclaim that they are vegan? There's nothing wrong with using tools any which way you want, but the reason d'entre for Rust is fearless concurrency, and the distinction between borrowing and moving, with the addition of Send and Sync marker traits, is kind of the whole point of the langauge. I agree that it could still be a good language without these, but if it wasn't for these features, I doubt there'd be nearly as much enthusiasm behind it.
Re:Bugs that the Rust compiler catches for you by SolitudeSF on Friday May 06, 2022 @04:31AM (#31282809)
this not even close to expert knowledge, thats entry level
Re:Bugs that the Rust compiler catches for you by melissalobos on Thursday May 05, 2022 @08:54PM (#31279977)
Rust is slightly unusual in that most users/potential users of it tend to be very vocal about it. It would be nice if their knowledge matched their enthusiasm.
Re:Bugs that the Rust compiler catches for you by macintux on Friday May 06, 2022 @12:22AM (#31281289)
> Rust is slightly unusual in that most users/potential users of it tend to be very vocal about it.

Or that the only users you know about are vocal…because how would you know about the non-vocal ones?

Re:Bugs that the Rust compiler catches for you by ben0x539 on Thursday May 05, 2022 @09:01PM (#31280031)
let people enjoy things
Re:Bugs that the Rust compiler catches for you by ben0x539 on Thursday May 05, 2022 @09:01PM (#31280036)
like that's how you get the knowledge, you're enthusiastic about a thing and then spend a bunch of time with it and then you build up knowledge. it's healthier in that order.
Re:Bugs that the Rust compiler catches for you by Xunjin on Thursday May 05, 2022 @09:47PM (#31280321)
Ohhh please this is language wars, people don't want healthy arguments, they just want to pick a side and argue, just to earn internet points :D
Re:Bugs that the Rust compiler catches for you by pjmlp on Friday May 06, 2022 @01:44AM (#31281696)
Data race is only helpful for threaded code accessing data structures in-memory.

For all the other scenarios of distributed computing or OS IPC, it does very little.

Plus Rust lacks a story how it can work with OpenMP and OpenACC.

Re:Bugs that the Rust compiler catches for you by oconnor663 on Friday May 06, 2022 @04:37AM (#31282842)
> For all the other scenarios of distributed computing or OS IPC, it does very little.

It might be worth clarifying that catching data races isn't just about catching race-conditions-which-are-probably-bugs. Data races are full-blown undefined behavior in the C/C++/Rust memory models, which can (not necessarily frequently but under the right conditions) corrupt memory just as badly as a use-after-free or an out-of-bounds write.

Re:Bugs that the Rust compiler catches for you by pjmlp on Friday May 06, 2022 @04:45AM (#31282886)
Agreed, however when talking about how great Rust deals with those, we should not forget it is only one use case among many others where Rust currently doesn't do any better than the competition.

Specially if we take into consideration that focusing back into processes is the only solution to prevent certain exploits.

Re:Bugs that the Rust compiler catches for you by shaklee3 on Friday May 06, 2022 @09:17AM (#31284750)
Rust does not have a memory model.