3 ms·
> In terms of correctness, I've never heard claims about improving security issues I would argue that the rest of your paragraph talks about how Rust (indirect
by majewsky 9y ago
> In terms of correctness, I've never heard claims about improving security issues
I would argue that the rest of your paragraph talks about how Rust (indirectly) improves security issues.
> As for compiler errors not helping you understand the problem, I have yet to encounter a compiler that does that.
Try misplacing a { in an average LaTeX document. But don't say that you haven't been warned. ;)
Alternatively, write some C++ code that uses std::map<std::string, std::string> or something like that incorrectly, and marvel at the page-long exceptions with all the default template arguments expanded into an unreadable mess.
> Also, the Rust compiler appears pretty vibrant with lots of improvements being made to help with user friendliness, so it's possible that further improvements in inference might reduce the problem spots (it's already pretty magic to me).
I also recently got into Rust (coming from Go), and the thing I miss most is `gofmt`. Is there a standard tool-enforced coding style for Rust that the community agrees on, in the same way that the Go community has by and large agreed on gofmt?
- timClicks 9y agorustfmt https://github.com/rust-lang-nursery/rustfmt https://github.com/rust-lang-nursery/rustfmt
- DougBTX 9y agoThere is rustfmt https://github.com/rust-lang-nursery/rustfmt https://github.com/rust-lang-nursery/rustfmt though it is a work in progress: https://github.com/rust-lang-nursery/fmt-rfcs https://github.com/rust-lang-nursery/fmt-rfcs
- aplanas 9y ago> Is there a standard tool-enforced coding style for Rust that the community agrees on, in the same way that the Go community has by and large agreed on gofmt? https://github.com/rust-lang-nursery/rustfmt https://github.com/rust-lang-nursery/rustfmt And is planned to be distributed with the compiler and the cargo stack by default
- johnnyanmac 9y agoUgh, C++ template errors, the bane of my existence (and why I personally avoid using anything beyond dead-simple ones unless I have to interface with STL). Only thing worse are Java generics, if only because they literally tried to tack them in 10 (heck, getting close to 15 years now) years ago and we are still feeling the consequences of those design choices today, (unless Java 8+ made major fixes to this. Haven't used it in enough detail to make a judgement).
- jcelerier 9y agotemplate errors blurb a big wall of text, but if you know how to read it it only takes a few second to find in your code where your problem is. You generally just have to look at the "required from here" (in clang and gcc at least) message which points to your own code 9 times out of ten. https://my.mixtape.moe/xdkchm.webm https://my.mixtape.moe/xdkchm.webm
- vlovich123 9y ago> I would argue that the rest of your paragraph talks about how Rust (indirectly) improves security issues. I think perhaps I didn't communicate my meaning clearly enough. Rust does significantly reduce the risk of a certain class of security problems (reduce not eliminate since it's highly unlikely you'll have 0 unsafe{} blocks anywhere in your dependency chain). That's not disputable since that's part of the language design. That's certainly an advantage it has over C/C++. However, security is far more than just memory safety & I have read nowhere that writing more secure code is a design goal for Rust (I'm not even sure yet such a thing is possible). > Try misplacing a { in an average LaTeX document. But don't say that you haven't been warned. ;) > Alternatively, write some C++ code that uses std::map<std::string, std::string> or something like that incorrectly, and marvel at the page-long exceptions with all the default template arguments expanded into an unreadable mess. I agree 100%. I think perhaps you misread what I wrote? I said I have not encountered a compiler where the errors helps you understand a language. > Is there a standard tool-enforced coding style for Rust that the community agrees on, in the same way that the Go community has by and large agreed on gofmt? rustfmt
- manveru 9y agoI think Elm has some of the best engineering around that: http://elm-lang.org/blog/compiler-errors-for-humans http://elm-lang.org/blog/compiler-errors-for-humans and http://elm-lang.org/blog/compilers-as-assistants http://elm-lang.org/blog/compilers-as-assistants While it's also not perfect or can correctly identify all possible syntax/intent errors, it's a valuable tool to learn the language nonetheless.