top | item 47126991

(no title)

pizlonator | 8 days ago

I think if Rust wants to evolve even more aggressively than C++ evolves, then that is a chasm that needs to be crossed.

In lots of domains, having a language that doesn't change very much, or that only changes very carefully with backcompat being taken super seriously, is more important than the memory safety guarantees Rust offers.

discuss

order

jjmarr|8 days ago

In my view, this is a good thing.

As a C++ developer, I regularly deal with people that think creating a compiled object file and throwing away the source code is acceptable, or decide to hide source code for "security" while distributing object files. This makes my life hell.

Rust preventing this makes my life so much better.

zozbot234|7 days ago

Rust does not prevent you from creating a library that exports a C/C++ interface. It's indistinguishable from a C or C++ library, except that it's written in Rust. cbindgen will even generate proper C header files out of the box, that Rust can then consume via bindgen.

pizlonator|8 days ago

> As a C++ developer, I regularly deal with people that think creating a compiled object file and throwing away the source code is acceptable, or decide to hide source code for "security" while distributing object files. This makes my life hell.

I mean yeah that's bad.

> Rust preventing this makes my life so much better.

I'm talking about a different issue, which is: how do you create software that's in the billions of lines of code in scale. That's the scale of desktop OSes. Probably also the scale of some other things too.

At that scale, you can't just give everyone the source and tell them to do a world compile. Stable ABIs fix that. Also, you can't coordinate between all of the people involved other than via stable ABIs. So stable ABIs save both individual build time and reduce cognitive load.

This is true even and especially if everyone has access to everyone else's source code

SkiFire13|8 days ago

C++ is still changing quite a lot though, just not in ways that fix the existing issues (often because doing so would break ABI stability).

pizlonator|8 days ago

That is a reason why a lot of folks stick with C.

In some sense, the chasm I'm describing hasn't been crossed by C++ yet

PunchyHamster|7 days ago

I think it's the domains that need to evolve, because the effects of that approach have been very bad for a very long time already

Gigachad|7 days ago

Isn’t this solution solved by just compiling your libraries with your main app code? Computers are fast enough that this shouldn’t be a huge issue.

squirrellous|7 days ago

This assumes a lot:

- the same entity has access to the source of both the library and the main app

- library and main app share the same build tooling

And even if that’s the case, you have the problem of end users accidentally using different versions of the main app and the library and getting unexpected UB.

ozgrakkurt|7 days ago

In what way rust needs to evolve? It seems pretty evolved to me already but I’m no language expert