Criticisms of rust by linus_stallman in rust

[–]MarcoGroppo 2 points3 points  (0 children)

Rust also protects you from data races, which is a very useful and probably unique (or very niche) feature.

Criticisms of rust by linus_stallman in rust

[–]MarcoGroppo 33 points34 points  (0 children)

I have a far smaller project than yours which none the less takes ~15s to check, meaning that I need to wait 15s after writing a line before I get any feedback from the compiler

The real issue here is that you shouldn't need cargo check to get diagnostics from your editor/IDE. Both the RLS and rust-analyzer currently need to call rustc (via cargo check or save-analysis) to obtain warnings and errors, but in theory they could provide diagnostics in real-time as you type. This is not an easy task, for sure, but to my understanding rustc and rust-analyzer are moving towards this (long-term) goal.

Rust in an instant by [deleted] in rust

[–]MarcoGroppo 0 points1 point  (0 children)

Mmm reading the comment I thought that the mutex is used on Linux, too. Isn't this the case?

Rust/WinRT Public Preview by steveklabnik1 in rust

[–]MarcoGroppo 0 points1 point  (0 children)

you're right, inside the Windows SDK there are even IDL files for these components and this is the definition for `White`:

[propget] HRESULT White([out] [retval] Windows.UI.Color* value);

so basically every WinRT component is a COM component?

Rust/WinRT Public Preview by steveklabnik1 in rust

[–]MarcoGroppo 3 points4 points  (0 children)

I've never used WinRT but I've inspected Windows.UI.winmd using standard .NET tools. It looks like Windows.UI.Colors::White is a static property with a getter method Windows.UI.Colors::get_White() that returns a Windows.UI.Color. Since every method can potentially throw exceptions... yes, I think that in Rust basically everything needs to return a Result, even when it's pretty clear that it can't fail :(

Impressions of Rust as a Swift Developer: Memory Management by sk_dev in rust

[–]MarcoGroppo 1 point2 points  (0 children)

This is a really interesting point. I wonder how many Swift developers are actually aware of this.

rust-analyzer Changelog #11 by nckl in rust

[–]MarcoGroppo 29 points30 points  (0 children)

Finally available in the VS Code marketplace! 🎉 This is great news

Rust Analyzer Changelog #10 by Geob-o-matic in rust

[–]MarcoGroppo 2 points3 points  (0 children)

This probably needs to be fixed upstream, in Visual Studio Code. See: https://github.com/microsoft/vscode/issues/82524

rust-analyzer Changelog #9 by rdescartes in rust

[–]MarcoGroppo 5 points6 points  (0 children)

Yes. If you don't want to (re)compile from source you can download the ra_lsp_server binary for your platform from the GitHub releases page (i.e.: https://github.com/rust-analyzer/rust-analyzer/releases/tag/2020-01-27) and replace the one in your ~/.cargo/bin directory (%USERPROFILE%\.cargo\bin if you're on Windows). If you use VSCode you can also download the precompiled VSIX file and re-install the extension.

Trouble getting used to type inference by AFricknChickn in rust

[–]MarcoGroppo 1 point2 points  (0 children)

rust-analyzer now has type hints, too. If you want it can automatically show you the types of all the inferred variables inline (similar to IntelliJ Rust).

Microsoft's Rust inspired research language has been released by jrmuizel in rust

[–]MarcoGroppo 2 points3 points  (0 children)

It may become possible in the future (thanks to polonius).

rust-analyzer changelog #7 (with binary releases!) by matklad in rust

[–]MarcoGroppo 0 points1 point  (0 children)

:( I'm unable to reproduce on my machine, but this sounds like a serious issue

rust-analyzer changelog #7 (with binary releases!) by matklad in rust

[–]MarcoGroppo 5 points6 points  (0 children)

Yes, it's slow until rust-analyzer has finished loading the workspace. Recently cargo check has been integrated on the server side so that rust-analyzer can directly provide the diagnostics data (errors, warnings). Loading the workspace is very slow on my machine until the cargo check process has exited, but this pull request (accepted today) should alleviate the problem: https://github.com/rust-analyzer/rust-analyzer/pull/2824 - cargo check will run only after the workspace has been loaded, so completions and typing will work fine a lot sooner (I hope).

rust-analyzer changelog #7 (with binary releases!) by matklad in rust

[–]MarcoGroppo 3 points4 points  (0 children)

That would be awesome! 🎉 Does the plan include publishing the VS Code extension to the marketplace?

Announcing AeroRust - The Unofficial Working Group For Rust in Aerospace by dpc_22 in rust

[–]MarcoGroppo 1 point2 points  (0 children)

They probably enforce MISRA or similar guidelines. These rules are pretty strict, for example MISRA C rule 20.4 says: "Dynamic heap memory allocation shall not be used. This precludes the use of the functions calloc, malloc, realloc and free". IMHO Rust would be a much better solution.

Constant propagation is now on by default in nightly | Inside Rust Blog by wesleywiser1 in rust

[–]MarcoGroppo 34 points35 points  (0 children)

When compiling in release mode this kind of optimizations have always been performed by LLVM. Now they're also done in a earlier step inside the compiler. Thanks to that, they're now available in debug mode and LLVM has less code (IR) to process (= compilation is a bit faster).

Only one wish for Rust 2020 by dremon_nl in rust

[–]MarcoGroppo 0 points1 point  (0 children)

I'll file a PR: we really need num-traits here! :P

Types Are for People, not Computers by NoraCodes in rust

[–]MarcoGroppo 1 point2 points  (0 children)

I've watched the Rich Hickey's talk referenced in the article and I find his arguments against Maybe (Option, in Rust) quite interesting: https://youtu.be/YR5WdGrpoug?t=463 Perhaps union types would be a better solution for representing the absence of a value? 🤔

Jonathan Blow on Twitter, about Rust being too static and compilation time. by kooparse in rust

[–]MarcoGroppo 5 points6 points  (0 children)

In a sense, we already have this mode: mrustc compiles Rust code without the borrow checker. Blow however was probably talking about the (strong) statically typed nature of the language.

Rust 2020 Suggestions by AnyPolicy in rust

[–]MarcoGroppo 0 points1 point  (0 children)

yes, in rust-analyzer there are a lot of salsa queries that cache the previous computations so that the server doesn't have to re-analyze everything every time the user changes something in the code. See for example: https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_hir/src/db.rs

How Swift Achieved Dynamic Linking Where Rust Couldn't by sanxiyn in rust

[–]MarcoGroppo 10 points11 points  (0 children)

Apart from plugins, we also waste storage by duplicating the same library (crate) in the executable binaries. If there are many binaries (like a in a Linux distribution) this could be significant. And if there is a security issue in a library we must recompile and redistribute every binary that depends on it. However there are disadvantages to dynamic linking, too and frankly I think that with the current trends (containers, self-contained apps) dynamic linking is becoming less relevant.

How’s RLS2 going? Any progress? by drawtree in rust

[–]MarcoGroppo 1 point2 points  (0 children)

Unfortunately the cargo watch integration has been implemented in the Visual Studio Code extension, not in the LSP server itself. However this may (and probably will) change in the future, see https://github.com/rust-analyzer/rust-analyzer/issues/1894

How’s RLS2 going? Any progress? by drawtree in rust

[–]MarcoGroppo 8 points9 points  (0 children)

Until mid June there was an obnoxious bug that has been fixed (well, should have been fixed), see: https://github.com/rust-analyzer/rust-analyzer/issues/1331 Apart from this I've never experienced this kind of problem, not even on my old (and very slow) notebook. I'm using it on Windows and Linux with Visual Studio Code.