Rust Needs an Official Specification
tweedegolf.nl
Rust Needs an Official Specification
1–10 of 53 posts
Re: Rust Needs an Official Specification
#2Re: Rust Needs an Official Specification
#3Re: Rust Needs an Official Specification
#4Re: Rust Needs an Official Specification
#5That’s almost like calling delete in c++ and if you changed the C++ code to a class with a print in the destructor, then called “delete” you would get the same behavior.
The “just” underscore in rust I believe is special and basically makes that value inaccessible. So that value really does “destruct” there.
Re: Rust Needs an Official Specification
#6[flagged]
but it does feel like Rust is designed for people learning about ALL of the modern compute stack, legacy compatibility included.
Re: Rust Needs an Official Specification
#7 let _ = Foo;
my immeidate thought was "this is going to get cleaned up immediately", which turns out to be the case. If you come from a language where braces define scopes and variables only get cleaned up when a variable goes out of scope, Rust's behavior may be surprising but it's consistent and correct. The object is immediately out of scope.Three thoughts:
1. Up until a certain point, being able to develop the language without updating a specification is useful. When you reach a certain level of maturity, you need a spec. I think Rust is nearing that inflection point;
2. A spec will make it harder to make breaking changes. That's a good thing. I can't but help think of Python 3. The seal was broken and every point release (it seems) makes breaking changes. That's not a good thing; and
3. A spec doesn't prevent undefined behavior. C/C++ have lots of undefined behavior. Sometimes later spec revisions will address this. Sometimes not.
Re: Rust Needs an Official Specification
#8Re: Rust Needs an Official Specification
#9A more accurate title would be 'Marc Needs an Official Rust Specification.' It’s entirely possible that the Rust community’s needs don’t align with this.
Re: Rust Needs an Official Specification
#10So with Rust, the implementation is the specification. The author mentioned gccrs - hasn't that already had some positive standardization benefits without a true standard? I'm not super knowledgable about the status there, though.
I feel like more standardization is certainly worthwhile, but writing a specification is an entirely different beast. I see that as years of painstaking work just to keep everything mostly the same and harder to iterate. Seems like a hard sell even if it would be great for systems programmers ;)
> For developing external code analysis tools such as Coverity
You can do that by just using intercepting `rustc` and using the static analysis tool's common IR(s), right? I'm nitpicking here, though.