News for hackers. Stuff that matters.
Re:Python startup time: milliseconds matter by geofft on Wednesday May 02, 2018 @06:28PM (#16981716)
The last three paragraphs of the section "Why use Rust?" should address that - basically, they have experience with solving this problem by writing parts of the code in C, they are not fans of that experience, and Rust is a compelling better C (and there are specific reasons they don't think C++ is compelling).

Are you asking in comparison to some other language? The most obvious other languages in the "compelling better C" niche I think are Ada, D, and Go; Ada and D (I think, I do not know them well) don't have as good of a standard library or outside development community, and Go is less suited to Rust to replacing portions of a process. Go would be a reasonable choice were one writing a VCS from scratch today.

Re:Python startup time: milliseconds matter by quotemstr on Wednesday May 02, 2018 @06:49PM (#16981838)
The C++ rationale is bizarre. That a 2008 compiler doesn't provide modern features is unsurprising. They've chosen to use Rust is a strange reaction to this limitation, since it would be just as easy, from a toolchain perspective, to just use a modern C++ compiler.
Re:Python startup time: milliseconds matter by CJefferson on Thursday May 03, 2018 @12:09PM (#16987196)
One big advantage of rust is that (while some people won't like this), rust assumes you won't install it from your package manager, but download a script which installs it in your home directory. This script is quick and easy.

Trying to install a c++ compiler from source (and I've done it several times) is a much less plesent experience, so most people stick with what their package manager provides.

Re:Python startup time: milliseconds matter by adrianN on Thursday May 03, 2018 @12:34AM (#16983371)
Language features aside, Rust is a lot nicer to work with because it has cargo and using libraries is no longer a pain.
Re:Python startup time: milliseconds matter by pjmlp on Thursday May 03, 2018 @03:14AM (#16983963)
Depends which libraries we are talking about, try to use GUI libraries from Rust.
Re:Python startup time: milliseconds matter by mratsim on Thursday May 03, 2018 @04:25AM (#16984234)
That isn't fair, all languages besides JS+HTML+CSS have issues with GUI libraries. Either you go Electron/webview or you have to deal with Qt/GTK for cross-platform GUI.
Re:Python startup time: milliseconds matter by pjmlp on Thursday May 03, 2018 @04:53AM (#16984357)
Sure it is fair, Java, C++, C#, VB.NET, Delphi, Objective-C, Swift have quite good GUI libraries available.

And regarding JS+HTML+CSS, they are still on the stone age of RAD tooling.

Re:Python startup time: milliseconds matter by mratsim on Thursday May 03, 2018 @11:43AM (#16986985)
I think you missed the cross-platform part of my answer.
Re:Python startup time: milliseconds matter by pjmlp on Thursday May 03, 2018 @12:48PM (#16987572)
Some of those languages do have cross-platform GUI offerings.

Even AWT is better than any option currently natively available to Rust.

After all, "using libraries is no longer a pain" is not what I felt when converting an old toy application from Gtkmm to Gtk-rs.

Re:Python startup time: milliseconds matter by dom96 on Wednesday May 02, 2018 @07:17PM (#16981995)
> Go is less suited to Rust to replacing portions of a process

How so? Is it because Go has a GC and Rust doesn't?

Re:Python startup time: milliseconds matter by geofft on Thursday May 03, 2018 @12:46AM (#16983409)
That's part of it, but more generally, Rust prioritizes fitting into other programs: it offers direct compatibility with the C ABI for functions and structs (because the C ABI is the effective lingua franca for ~all present-day OSes), it uses regular C-style stacks instead of segmented stacks, threading is implicit, calls between Rust and C in either direction are just regular function calls and involve no trampolines or special handling by the GC/runtime, there is no runtime that requires initialization so you can just call into a random Rust function from a C program without setup, etc.

Go has cgo, and has slowly come to a few of the same decisions (e.g., Go gave up on segmented stacks too), and gccgo exists, so it's certainly possible to use Go for this use case. But it's not as suited as Rust.

There's a nice post about calling Rust from Go which goes to lengths to avoid the cgo overhead, even though Rust can just directly expose C-compatible functions and cgo can call them without any special effort on either side: https://blog.filippo.io/rustgo/

Re:Python startup time: milliseconds matter by masklinn on Thursday May 03, 2018 @05:38AM (#16984517)
> How so? Is it because Go has a GC and Rust doesn't?

More generally a heavy runtime, which creates issues when you're trying to replace parts of a process which has its own runtime, unless you can make the two cooperate (by actually using the same runtime e.g. jvm or graal or whatever).

Go's FFI is also easy to work with but the source of… other issues which is why the Go community often prefers reimplementing things entirely to using cgo and existing native libraries.

Re:Python startup time: milliseconds matter by unrealhoang on Wednesday May 02, 2018 @10:03PM (#16982815)
Yes, manually move objects between GCs is tricky.