News for hackers. Stuff that matters.
Re:The relative performance of C and Rust by vvanders on Friday September 28, 2018 @11:41PM (#18098597)
I don't think I've seen anyone claiming that Rust is a perfect language without flaws. Heck I'd hold up all of the huge strides that have been made in errors, usability and constant feedback as a counter example of that.

You see a lot of people holding up Rust precisely because we've been there for the last 5/10/15/20 years. The day I don't have to write a makefile or build yet another CMakeLists.txt is the day I rejoice.

What Rust offers is another option in the native, non-GC'd language space. A space that has very few languages and even fewer yet that are shipped at scale. Rusts inclusion w/ FF means that the have to address the robustness, security, performance and usability of the language to a degree that you don't commonly see.

Having just blown 4+ hours today dealing with the linker on a mixed C/C++ project I don't really miss a lot of the baggage that comes with native development these days. Rust gives you the option of dropping down to that level while still preserving a set of sane, opinionated defaults that are pretty well thought out.

Re:The relative performance of C and Rust by kxyvr on Saturday September 29, 2018 @12:07AM (#18098654)
Since you made a mention of CMake, does Rust really provide an alternative for building multilanguage projects? When I went to look for examples on how this is managed, it seemed horrendous. For example, some projects manage this by writing a program to download, unzip, and build the source:

https://github.com/elrnv/ipopt-rs/blob/master/ipopt-sys/buil...

Others just assume that the libraries are there, but they still require a program to compile them:

https://github.com/cmr/openblas-src/blob/master/build.rs

As long as all of the dependencies are in Rust, things appear nice. At the same time, unless I'm missing something, it seems like crates manages multilanguage projects poorly. Though I have some major gripes with CMake, I've managed multilanguage projects mostly well.

Is there a sane way outside of CMake to manage a multilanguage project with Rust?

Re:The relative performance of C and Rust by blakesmith on Saturday September 29, 2018 @12:47AM (#18098766)
Check out Bazel: http://bazel.build. I've been using it a lot to build several multi lingual projects that include Java, C++, embedded C, Javascript, CSS, and even Docker images. There are community Rust rules, that I haven't tried yet, but am planning on investigating soon: https://github.com/bazelbuild/rules_rust
Re:The relative performance of C and Rust by digitaLandscape on Saturday September 29, 2018 @09:30AM (#18100205)
Is there a non-Google alternative for those of us who don’t want our builds spied on?
Re:The relative performance of C and Rust by OtterCoder on Saturday September 29, 2018 @12:47AM (#18098765)
Not so much with Rust in the driver's seat. Cargo, Rust's primary toolchain, only has weak support for pre/post build scripts. It's solely concerned with Rust's own dependencies and compilation. In the couple of projects where I've added Rust to a larger project, it's always been bash or node that coordinates the overall build.
Re:The relative performance of C and Rust by oever on Saturday September 29, 2018 @11:30AM (#18100909)
You can call a compiler for C/C++ from build.rs. That tooling is currently not very advanced. As far as I know there is no crate to write compile recipes that as easily as a Makefile or CMakeLists.txt.

When I tried this in build.rs, I had to check modification times myself.

There is an opening for a ninja-type crate in Rust.

Re:The relative performance of C and Rust by AceJohnny2 on Saturday September 29, 2018 @12:35AM (#18098732)
Indeed. Rust is the only new contender in the field of systems programming, where C++ has to contend with decades of negative mindshare (C++11: "I've changed! I promise!"), and D, well, never really took off (because it started off in the early Internet era as a commercial compiler?).
Re:The relative performance of C and Rust by lasagnaphil on Saturday September 29, 2018 @01:51AM (#18098911)
There is also Zig, which seems nice as a C replacement but still highly unstable, and Jai, which is also a nice C replacement but currently has no publicly available compiler yet... So for the time Rust is the only new systems programming language (And please don’t say Go/Nim is a contender, they’re good languages in their own ways but having a garbage collector disqualifies it fron that categorization)
Re:The relative performance of C and Rust by geezerjay on Saturday September 29, 2018 @02:12AM (#18098973)
> Jai, which is also a nice C replacement but currently has no publicly available compiler yet...

If there is no compiler then there is no programming language.

Re:The relative performance of C and Rust by timClicks on Saturday September 29, 2018 @03:33AM (#18099152)
Well, there are videos of code being compiled. But nothing verifiable outside of the Jai team.
Re:The relative performance of C and Rust by geezerjay on Saturday September 29, 2018 @10:29AM (#18100539)
> Well, there are videos of code being compiled.

There are videos of nazi bases on the moon.

Re:The relative performance of C and Rust by majewsky on Saturday September 29, 2018 @07:11AM (#18099774)
If that counts as existing, then cold fusion exists.
Re:The relative performance of C and Rust by potiuper on Saturday September 29, 2018 @12:45PM (#18101315)
Re:The relative performance of C and Rust by pjmlp on Saturday September 29, 2018 @07:08AM (#18099764)
No language that drops C compatibility while having the same manual memory management is an actual contender.

Yes having a GC is a contender, because not all GCs are implemented the same way, and C did not eliminate Assembly as well.

So if a systems language, with GC, covers 95% of use cases. We can happily use something else for those remaining 5%, while enjoying better productivity and safety.

Companies like Astrobe manage to have enough customers to keep their Oberon compiler for bare metal deployments business alive, just as one possible example.

Re:The relative performance of C and Rust by kiriakasis on Saturday September 29, 2018 @03:43PM (#18102378)
Re:The relative performance of C and Rust by vmchale on Saturday September 29, 2018 @03:03AM (#18099085)
ATS is in a better state than Zig/Jai lol
Re:The relative performance of C and Rust by vmchale on Saturday September 29, 2018 @03:01AM (#18099079)
> You see a lot of people holding up Rust precisely because we've been there for the last 5/10/15/20 years. The day I don't have to write a makefile or build yet another CMakeLists.txt is the day I rejoice.

Ironically, cargo is one of the areas the rust ecosystem falls down completely. Not to mention, there's no ABI...

> What Rust offers is another option in the native, non-GC'd language space.

True, and while this is great in principle for embedded development, not using a GC is overrated.

> Rust gives you the option of dropping down to that level

Well, if you're not dealing with the linker, you're not at "that level"