r/cpp • • Oct 03 '26

C++ future at Adobe

So if anyone was still curious what happened to Hylo, or where Adobe stands in regards to the whole safety discussion,

David Sankel has done a talk at RustConf on the matter, Zngur: Simplified Rust/C++ Integration.

The way Adobe now sees C++ is described on slide 2, at 50 seconds mark.

80 Upvotes

111 comments sorted by

View all comments

Show parent comment

8

u/-kl0wn- Oct 03 '26

I don't understand the hype with rust. The compile times are atrocious, dynamic linking isn't really a thing, it's incredibly verbose.

45

u/foonathan Oct 03 '26
  • Definition checked generics
  • Destructive move semantics that prevent use-after-move
  • First-class tuple and variant types with pattern matching
  • Usable built-in types without weird implicit conversions
  • Incredible tooling (one standardized package manager and build system, genuinely useful compiler diagnostics, a documentation generator that actually works)
  • No weird historical baggage
  • A standard library that actually gives you convenient utility functions, without ABI constraints, and good data structures

25

u/13steinj Oct 03 '26

No weird historical baggage

I think the major problem with these debates is people aren't being truthful with themselves.

It's not historical baggage. It's ISO / WG21 process baggage.

The Beman project had a whiteboard asking people what they wanted for C++29. I pointed at two of the things and said "that's never going to happen." I actually forget what those two things are, but my opinion was formed because the only way you could encode some information needed to do it is into the ABI (or PIMPL it to hell and incur a cost, but even then I don't think it would work out). But the necessary data is sensitive to a security context, so as security practices change (rapidly, possibly even faster than a 3 year cycle), C++ might need to change with it. One of the Beman folks told me I was wrong and pointed to... getting more accurate on string representation of floating point, and std::copyable_function (which I'd argue is a point in my favor).

Python, Java, ECMAScript have "historical" baggage. But they still evolve. They remove broken things. They add new things and change APIs, sometimes with a deprecation schedule. So does Rust.

Almost all of the advantages of Rust you stated, have in some way been proposed for C++ but been (not in bad faith, but it's the closest term I can use) slow-rolled and sandbagged in the standardization process.

9

u/tialaramex Oct 03 '26

Rust isn't allowed (by its own rules) to change standard library APIs except if they're unsound. Rust is allowed to evolve, but it finds ways to do so without making this sort of disruptive change.

I agree with the thrust of your point though. WG21 is a big part of the problem.

34

u/gmueckl Oct 03 '26

Rust will accumulate the same kind of smelly baggage over time. It's just too young to have accumulated that much of it just yet.

15

u/foonathan Oct 04 '26

And by that point, there's hopefully another new language that took everything Rust did wrong and learned from it.

6

u/JuanAG Oct 05 '26 edited Oct 05 '26

It already has

https://doc.rust-lang.org/std/macro.try.html

"Deprecated since 1.39.0: use the ? operator instead"

If you use Rust v1.0 code with try!() will compile fine, if you use the newest version it wont unless you specify you want to use v1.0 rules which in Rust is called Editions, Edition 2015 will allow that code to compile with no issues on current compilers

2015 Edition => https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=2dd3864ec43dee432232f5899685718b

2018 Edition => https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=b52927db7c317cebc3f57babda4a1004

Same code, 2015 compiles and run, 2018 where try! was deprecated and used dont compile

So you can break code as much as you want without being a big deal, old code will keep compiling even if a breaking change happens and new code will get the new shinny feature instead of the smelly one, a shame C++ didnt wanted this feature, Rust team was smarted and copied the epoch concept on the lang

3

u/gmueckl Oct 05 '26

This seems nice on the surface, but this causes two issues on the maintainers' side:

  1. The compiler must keep all the front-end variants for old editions. Eventually, this becomes a maintenance nightmare.
  2. Editions interact. Being able to compile code as one edition doesn't make it automatically compatible with code compiled with a different edition. The kind of changes thst can go into editions need to be reviewed carefully- old baggage is still weighing the language down in this model.

It's a different trade-off. And in my mind it it is the nightmare difficulty setting on compiler development.

4

u/JuanAG Oct 05 '26

Someone has to take care, it is going to be every user or the lang dev team, Rust choosed the dev team and C++ opted for the user, every of us, for me and many average devs the choice is clear, let a third party do the job so i dont need to, thats why Rust popularity is they way it is while Nim, Odin, Zig and all the rest not so much

And Rust have some guardrails in place to prevent Editions to conflict among them, is very simple, they compile the whole public repositories of GitHub (and GitLab i think) and if nothing fails to build it is released. Smart and simple, proof in the podding leaving out theoretical questions of "what if" or "how could XYZ affect" or ... This is thanks to Amazon providing free use of AWS to the Rust team, when this is not the case anymore will see but for now works like a treat and i can update Rust editions and version without any fear, something i cant say when i update my C++ compiler because i had issues in the past for this reason

1

u/13steinj Oct 05 '26

Well, the other problem is C++ doesn't have a "lang dev team." It's a spec without a reference implementation.

1

u/pjmlp Oct 06 '26

The "lang dev team" is taken care by existing practice, and no paper gets pushed beyond a specific gate, without a preview implementation, covering the full paper, not a subset of it.

It won't sort out every problem, but certainly will avoid those famous cases where the implementation was ignored, wasn't quite what the standard says, or were withdrawn from the standard years later.

8

u/QuaternionsRoll Oct 03 '26

Eh, if that were 100% true then editions would be unnecessary. You’re right that breaking changes are considered to be the absolute last resort, though.

9

u/tialaramex Oct 03 '26

But Editions don't change the standard library APIs?

What they can do is more interesting, but it doesn't change those APIs.

The 2027 edition is expected to make Goose..=Robin into a core::range::RangeInclusive<Bird> instead of core::ops::RangeInclusive<Bird>. If your Bird type isn't Copy and it doesn't make sense to iterate over Birds then this change is useless to you, although also why did you want Goose..=Robin anyway if birds aren't copyable or worth iterating over? For types like the integers this is a significant improvement, now 1..=5 will become Copy and IntoIterator as a programmer might expect in 2026. But the API doesn't change because the old types are still there, just the sugar points at the improved types.

13

u/jwakely libstdc++ tamer, LWG chair Oct 03 '26

But apart from that, what have the Romans ever done for us?

1

u/AnotherBlackMan Oct 03 '26

I don’t think a single one of these things is a positive in its own right. Rust makes humongous tradeoffs for all of them and a lot of tooling exist in cpp that help avoid the problems that that claims to solve. If devs want to take a runtime hit for safety they can run valgrind and sanitizers in prod

18

u/ts826848 Oct 04 '26

Rust makes humongous tradeoffs for all of them

I can see tradeoffs for some of the items in the list, but not for others. What humongous tradeoff is needed for first-class tuple/variant types with pattern matching, for instance?

If devs want to take a runtime hit for safety they can run valgrind and sanitizers in prod

Valgrind in prod would be quite the runtime hit.

1

u/AnotherBlackMan Oct 11 '26

Rust is also quite the performance hit and everyone pretends it’s okay. Valgrind also has actual memory safety guarantees unlike Rust

3

u/ts826848 Oct 11 '26

Rust is also quite the performance hit and everyone pretends it’s okay.

Even if you assume the first half of that sentence is true (and that's a rather debatable assumption to say the least) whatever runtime hit you experience with Rust is going to be nowhere close to the runtime hit you'd experience with Valgrind unless you're purposefully doing something obtuse. Even more so if you're dealing with a multithreaded program since Valgrind serializes your program.

Valgrind also has actual memory safety guarantees

At this point in time memory safety at the cost of an associated runtime is hardly anything special. Rust garnered the attention it did in no small part due to delivering memory safety without requiring that runtime.

But even putting that aside, Valgrind does not guarantee memory safety. Consider this obviously memory unsafe program:

#include <stdint.h>
#include <stdio.h>

void evil() {
    int j = 0;
    printf("%lu\n", (uintptr_t)&j);
    int* pj = &j;
    int* pi = &pj[-16]; // Adjust as necessary
    *pi = 4;
}

int main() {
    double i = 0;
    printf("%lu\n", (uintptr_t)&i);
    printf("%g\n", i);
    evil();
    printf("%g\n", i);
}

There's at least two distinct UBs (OOB pointer arithmetic/dereference and a strict aliasing violation), and yet Valgrind (and ASan/UBSan, for that matter) says the program is perfectly fine:

==35417== Memcheck, a memory error detector
==35417== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==35417== Using Valgrind-3.22.0 and LibVEX; rerun with -h for copyright info
==35417== Command: ./a.out
==35417==
137422174832
0
137422174788
1.97626e-323
==35417==
==35417== HEAP SUMMARY:
==35417==     in use at exit: 0 bytes in 0 blocks
==35417==   total heap usage: 1 allocs, 1 frees, 1,024 bytes allocated
==35417==
==35417== All heap blocks were freed -- no leaks are possible
==35417==
==35417== For lists of detected and suppressed errors, rerun with: -s
==35417== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Not really the output I'd hope to see from a solution that "has actual memory safety guarantees".

1

u/dawmster Oct 08 '26

Allocators? Containers that accept allocators in Standard library ?

1

u/foonathan Oct 09 '26

In nightly, for years. They will be in stable in the next release in a couple weeks.

6

u/the_one2 Oct 03 '26

Regarding verbosity: rust can be a little bit verbose for casts and such but the native variants (enums) and tuples alone makes me want to abandon c++

7

u/SuperV1234 https://romeo.training | C++ Mentoring & Consulting Oct 03 '26

Now also list the advantages.

3

u/KAMEHAMEHAMEHAAAA Oct 03 '26

I think thats your job.

-3

u/-kl0wn- Oct 03 '26

The tradeoffs don't seem necessary to me based on working on strut-labs.githib.io using agents.

→ More replies (3)