News for hackers. Stuff that matters.
Re:Rust-GPU: Making Rust a first-class language and ecosyste... by pjmlp on Saturday October 24, 2020 @06:39AM (#24878290)
Rust parallism guarantees are only applicable to threaded code and internal resources.

We have already learned to scale down from threads and go back to processes for security and stability reasons.

Here Rust doesn't help across IPC and data races of external resources.

One way that Rust compiles way slower than C++ is its Gentoo approach to libraries. With C++ I only compile my own code.

Re:Rust-GPU: Making Rust a first-class language and ecosyste... by creata on Saturday October 24, 2020 @07:04AM (#24878400)
> One way that Rust compiles way slower than C++ is its Gentoo approach to libraries. With C++ I only compile my own code.

That's a very good point, and maybe I'm being needlessly pedantic by considering it a part of the current (and only) implementation rather than a fundamental part of the language.

> We have already learned to scale down from threads and go back to processes for security and stability reasons.

Who is "we"? I still see a lot of parallel code being written with threads or async/await, and Rust's ownership system gives additional safety in both cases.

Re:Rust-GPU: Making Rust a first-class language and ecosyste... by pjmlp on Saturday October 24, 2020 @10:01AM (#24879275)
The browser vendors for example.
Re:Rust-GPU: Making Rust a first-class language and ecosyste... by creata on Saturday October 24, 2020 @10:34AM (#24879421)
Is it really the case they "have already learned to scale down from threads"? I'm obviously not well-versed in browser internals, but here's the very first sentence of "Threading and Tasks in Chrome":

> Chrome has a multi-process architecture and each process is heavily multi-threaded.

https://chromium.googlesource.com/chromium/src/+/master/docs...

Either way, I think browsers have a very specific scenario, where there isn't much interaction between the tabs, and they need to be well-isolated from each other. I don't think that's a good reason for everyone else to move away from threads.

Re:Rust-GPU: Making Rust a first-class language and ecosyste... by pjmlp on Saturday October 24, 2020 @11:15AM (#24879677)
Re:Rust-GPU: Making Rust a first-class language and ecosyste... by tlamponi on Saturday October 24, 2020 @07:46AM (#24878585)
> Rust parallism guarantees are only applicable to threaded code and internal resources.

No, it can apply for single threaded async stuff as well.

> One way that Rust compiles way slower than C++ is its Gentoo approach to libraries.

That's not true in at least two ways:

1. You can also produce shared libraries in rust, I know as we do so for some stuff.

2. C++ often has some much stuff in headers that you do not only compile your code..

Also, in my experience, the compile time is nonetheless (faster to slower):

1. C

2. Rust

3. C++

if one is doing a mid-sized or bigger project with lots of language features used.

Re:Rust-GPU: Making Rust a first-class language and ecosyste... by pjmlp on Saturday October 24, 2020 @10:01AM (#24879274)
Single threaded async is a special case of M:N threading model.

Shared libraries in Rust don't get distributed via cargo like Conan, vcpkg or OS package managers are capable of.

Too much C++ stuff in headers, yes that is a thing, specially in badly organized builds. Extern templates, incremental compilation and linking are also a thing, and VC++ already has experimental C++20 module support.

My dummy Gtk-rs test project to validate Rust improvements after each release takes 16 minutes currently on a core duo with 8 GB and SSD. The Gtkmm variant takes about 3 minutes, because it doesn't need to compile Gtk-rs on each compiler upgrade.

Re:Rust-GPU: Making Rust a first-class language and ecosyste... by frogfish on Saturday October 24, 2020 @07:04AM (#24878401)
Genuinely curious about the last sentence and would like to learn more on the Gentoo approach. Could you please provide a link or a little more details?
Re:Rust-GPU: Making Rust a first-class language and ecosyste... by creata on Saturday October 24, 2020 @07:06AM (#24878415)
By "the Gentoo approach", I think pjmlp is referring to the fact that Cargo crates are usually compiled from source for each project, rather than simply distributing binaries. See [the Wikipedia article for Gentoo](https://en.wikipedia.org/wiki/Gentoo_Linux):

> Unlike a binary software distribution, the source code is compiled locally according to the user's preferences and is often optimized for the specific type of computer.