News for hackers. Stuff that matters.
Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by saagarjha on Saturday June 13, 2020 @12:58PM (#23510794)
> Rust excels in creating correct programs. Correctness means, roughly, that a program is checked by the compiler for unsafe operations, resulting in fewer runtime errors.

This is a fairly low bar for correctness, and not really one I would really agree with :/

Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by staticassertion on Saturday June 13, 2020 @01:51PM (#23511212)
It's an extremely low bar, but one that hasn't been met by some popular languages.
Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by oxymoron on Saturday June 13, 2020 @06:31PM (#23513394)
I find that monadic error handling and null safety is as much of a game changer. It gets discussed less, and is obviously not unique to rust, but coming from Java I see what I’d guesstimate to be an order of magnitude difference in unhandled error cases.

The same logic can be applied in Java or C++ or probably even C, but it also comes down to the wide spread and idiomatic approaches of the language. The rust eco system is not necessarily coherent around the details of errors, but error handling is generally rigorous. The benefits of that can’t be overstated. The compiler is a huge help in getting it right in a way that Java checked exceptions never was.

I’m sure that there are other languages that are showing similar wins, though. I haven’t written much Swift, but I imagine that the experience might be similar?

Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by dbaupp on Saturday June 13, 2020 @06:04PM (#23513195)
Calling just “memory safety” correctness is a low bar and misses all sorts of other correctnesses (type safety, progress, matching-the-spec, etc.). However, it is a fundamental property: without memory safety, no other correctness can be guaranteed.
Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by tapirl on Saturday June 13, 2020 @10:48PM (#23514701)
So is it a property more important for inexperienced programmers?
Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by entha_saava on Sunday June 14, 2020 @12:12AM (#23515064)
You think only inexperienced programmers cause memory errors?

I am no fan of rust and actually hate its evangelism. But this is ridiculous.

Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by tapirl on Wednesday June 17, 2020 @11:16AM (#23552418)
... more ...
Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by neutronicus on Saturday June 13, 2020 @01:18PM (#23510959)
Launching the missiles is memory-safe!

Deleting the production database is a thornier philosophical question, but Rust's position is that it is.

Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by saagarjha on Saturday June 13, 2020 @01:31PM (#23511064)
Yeah, there's a couple of issues, one of which you mentioned :) Others are the fact that "runtime errors" are not necessarily bad; the goal is to prevent exploitable runtime errors. Crashing when you detect an out-of-bounds access is a bug and a runtime error, but one that is safe from a security perspective and as such something that Rust will do readily when necessary.
Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by loeg on Saturday June 13, 2020 @02:10PM (#23511357)
The bar here is C.
Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by lukevp on Saturday June 13, 2020 @05:00PM (#23512688)
Whenever I think about Rust vs C I think of Curl, where they've been working on a C program for decades that is used by an incredible amount of software, and they're still fixing memory leaks in it as recently as November 2019: https://curl.haxx.se/changes.html#7_67_0
Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by dagmx on Saturday June 13, 2020 @05:45PM (#23513047)
Rust considers memory leaks as safe. However I do find it easier to avoid memory leaks in Rust due to it’s stronger scope based dropping than when I write C.
Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by kahlonel on Saturday June 13, 2020 @08:10PM (#23513980)
You can leak memory in Rust too.
Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by saagarjha on Saturday June 13, 2020 @02:35PM (#23511558)
I think that bar is met by some term which means something synonymous with "this is better than C". When dealing with "correctness" I generally would like the program to do what I intended.
Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by bilkow on Saturday June 13, 2020 @04:46PM (#23512553)
I agree, and sincerely, I'm a Rust programmer and "memory safety" is definitely not why I use Rust. There are lots of memory safe languages but I feel more productive and get more satisfaction writing Rust than, say, Python, Lua or C++.

In Rust I feel like almost every time the program works on the first time it compiles successfully, even without writing tests. Probably a combination of very well designed API, builtin RAII, very explicit syntax, compiler strictness and clear docs. I also cannot forget to handle errors (even if I just decide to propagate or crash).

This is what "correctness" means to me, but it isn't exactly enforced by the compiler itself.

Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by m0xte on Saturday June 13, 2020 @02:44PM (#23511642)
The bar is set by the worst programmer not the worst language.
Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by MayorMonty on Saturday June 13, 2020 @02:51PM (#23511695)
The language works for the programmer. Those with a higher focus on safety (like rust) make the worst programmer better.
Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by albntomat0 on Saturday June 13, 2020 @02:59PM (#23511756)
Combined with the large number of vulnerabilities in mature, well-designed programs implemented by skilled programmers. The mythical programmer that can use C/C++ without bugs doesn't exist.
Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by m0xte on Saturday June 13, 2020 @03:00PM (#23511769)
The mythical programmer that can use Rust without bugs doesn’t exist either. I deal with higher level languages than rust and we’re capable of writing just as dangerous stuff through implementation errors.
Re:Microsoft: Rust Is the Industry’s ‘Best Chance’ at Safe S... by albntomat0 on Saturday June 13, 2020 @03:16PM (#23511892)
While bugs like logic errors clearly can exist in all languages, those that do things like memory management/enforce memory safety for the programmer eliminate whole classes of bugs.

No language/tool/etc will stop all programmer mistakes, but they can definitely stop some.