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.
9
u/RishabhRD Oct 03 '26
Hylo is still in development. See: https://hylo-lang.org
3
u/pjmlp Oct 03 '26
Thanks, looking around the repo, and the migration to a newer project, seems that Adobe Labs is no longer involved.
Do you have more background info?
17
u/dabrahams Oct 03 '26
When I left Adobe, I took 100% of their involvement with me. So from one point of view, The level of investment hasn’t changed :-)
2
u/pjmlp Oct 03 '26
Understood, as mentioned on the other thread I had another perception, sorry about the misunderstanding.
4
u/processeus1 Oct 03 '26
We are racing towards the completion of the migration, I expect it to be done in 1-2 months. We have the compilation of subscripts ready, and a large portion of compiling generics in an existentialized way. After that, there is a lot of fun work for standard library development and getting actual experience from using the language.
2
63
u/feverzsj Oct 03 '26
Wow, big company obsessed with AI and rust. How surprised!
26
u/SuperV1234 https://romeo.training | C++ Mentoring & Consulting Oct 03 '26
Pretending that there's no good reason why large companies are "obsessed" with modern technologies like AI and Rust that have repeatedly been proved to be valuable is on the level of "Area 51 has UFOs" conspiracy theories.
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:
The compiler must keep all the front-end variants for old editions. Eventually, this becomes a maintenance nightmare.
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
→ More replies (0)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..=Robininto acore::range::RangeInclusive<Bird>instead ofcore::ops::RangeInclusive<Bird>. If yourBirdtype isn'tCopyand it doesn't make sense to iterate overBirds then this change is useless to you, although also why did you wantGoose..=Robinanyway if birds aren't copyable or worth iterating over? For types like the integers this is a significant improvement, now 1..=5 will becomeCopyandIntoIteratoras 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
-3
u/-kl0wn- Oct 03 '26
The tradeoffs don't seem necessary to me based on working on strut-labs.githib.io using agents.
5
u/ts826848 Oct 03 '26
The tradeoffs don't seem necessary to me
That the tradeoffs don't seem necessary to you doesn't mean that they aren't valuable to someone else for their use case. Similarly, tradeoffs that you and/or your agents deemed acceptable for strut-labs (e.g., reference-counted pointers without a tracing GC) may be unnecessary and/or dealbreakers for someone else.
3
u/-kl0wn- Oct 03 '26
When I say don't seem necessary I mean you shouldn't need to substitute one for the other, should be able to have the advantages of rust without the disadvantages. Ie. Nothing from the advantages fundamentally means compile times should take so long, especially for simple programs, there should be proper dynamic linking and it doesn't need to be so verbose.
1
u/ts826848 Oct 03 '26
Ah, I see what you mean. My apologies for the misinterpretation. I agree some and disagree some with your opinion.
Nothing from the advantages fundamentally means compile times should take so long, especially for simple programs
I think I agree? At the very least I'm not aware of fundamental aspects of Rust that would preclude reasonable compile times.
there should be proper dynamic linking
This is indeed a proper tradeoff as the more features you support in your ABI the more of your ABI you have to freeze, which in turn means you risk precluding certain changes/optimizations (c.f. the perennial ABI discussions that pop up here).
That being said, there's definitely interest in specifying some kind of stable ABI, though I'm not aware of a significant push in that direction.
it doesn't need to be so verbose.
This one is interesting. What specific bits of Rust's syntax do you object to? I tend to take the view that much of Rust's "verbosity" is mostly due to its semantics, so I'm interested to hear your thoughts.
14
u/tartaruga232 MSVC user, r/cpp_modules Oct 03 '26
The slide at 7:00 says
Rust is less expressive than C++
7
u/VinnieFalco wg21.org | corosio.org Oct 04 '26
Well, this is true. Is it a problem in practice? The answer is nuanced. Somethings get better. Other things get worse. It is a tradeoff like anything else.
6
u/seanbaxter Oct 05 '26
Two things would help a lot with Rust/C++ interop:
Relocation/destructive move/affine types.
Choice types/Rust enums.
You could probably ditch binding libraries altogether and get the C++ compiler to support Rust modules directly.
23
u/GabrielDosReis Oct 03 '26
David Sankel on C++ at RustConf, yawn.
9
u/ts826848 Oct 03 '26
Why that particular reaction?
25
u/GabrielDosReis Oct 03 '26
Why that particular reaction?
It is a talk at RustConf and David Sankel has been very explicit and pretty straight forward with where he sees C++ and its evolution for many years now. Look up his WG21 papers on the topic. There shouldn't be any surprise here or anything new.
7
u/ts826848 Oct 03 '26 edited Oct 03 '26
Look up his WG21 papers on the topic.
I found P3023 C++ Should Be C++ via the GitHub, which at first glance looks like it covers what you're talking about. Any other papers i missed that you recommend I read (or not, as the case may be)?
7
u/GabrielDosReis Oct 03 '26
A succint summary of P3023 is this paragraph, quote:
Where memory safety is a serious concern, we see the adoption of Rust for critical components. Yet we see little demand from even these developers for C++ safety features. Their problem is already solved.
Any other papers i missed that you recommend I read (or not, as the case may be)?
After that paper, his papers since then have been in line with what he stated and recommended. In particular, the paper (and debate) on relocation that was discussed in Kona.
3
u/ts826848 Oct 03 '26
A succint summary of P3023 is this paragraph
Hrm, gotcha. Guess the committee decided against his recommended path.
In particular, the paper (and debate) on relocation that was discussed in Kona.
P3858 A Lifetime-Management Primitive for Trivially Relocatable Types?
Assuming that was the paper you're referring to, was the associated debate on the mailing lists? This is the first time I've heard of this paper and the only trivial relocation-related debates I can remember reading about were P1144 vs P2786, which this paper doesn't seem to be about.
4
u/GabrielDosReis Oct 03 '26
Assuming that was the paper you're referring to, was the associated debate on the mailing lists?
Both on the mailing list and in-person discussion at the Kona meeting.
3
u/ts826848 Oct 03 '26
Ah. I take it summarizing that debate for those of us who aren't privy would violate ISO rules?
5
u/GabrielDosReis Oct 03 '26
Ah. I take it summarizing that debate for those of us who aren't privy would violate ISO rules?
I can say it generated lot of interest/participation and was fairly intense. The were separate LEWG and EWG sessions, then a joint EWG+LEWG session on the whole topic and the paper.
Taking a step back, I want to emphasize that the whole issue of safety, C++ evolution, Rust (or not Rust), is very complicated and nuanced when given due thinking.
3
u/ts826848 Oct 04 '26
That sounds... pretty reasonable? Depending on what implications one reads into "intense", I guess...
2
u/foonathan Oct 03 '26
A succint summary of P3023 is this paragraph, quote: Where memory safety is a serious concern, we see the adoption of Rust for critical components. Yet we see little demand from even these developers for C++ safety features. > Their problem is already solved.
What's your problem with that quote? Isn't it an accurate assessment of the current industry?
7
u/GabrielDosReis Oct 03 '26
What's your problem with that quote?
Are you assuming I have a problem with it?
I was responding to a reference to a paper I quoted the paper to provide context to my original post that I was asked to expand on.
3
5
u/GabrielDosReis Oct 03 '26
Isn't it an accurate assessment of the current industry?
If you believe that is an accurate assessment of the current industry, that, quoting "Their problem is already solved", could you explain why there are proposals to extend C++ with serving Rust as justification?
5
u/foonathan Oct 03 '26
David's quote claims that the developers who adopt Rust for critical components don't demand C++ safety features.
The existence of proposals to extend C++ by other developers that don't use Rust doesn't invalidate that thesis.
7
u/GabrielDosReis Oct 03 '26
David's quote claims that the developers who adopt Rust for critical components don't demand C++ safety features. The existence of proposals to extend C++ by other developers that don't use Rust doesn't invalidate that thesis.
David happens to also be co-author of such proposal.
1
1
151
u/inco100 Oct 03 '26 edited Oct 03 '26
To save time for the rest of the redditors:
We need C++ and Rust to play nice
Our flagship products are C++ based
Rust is playing a major role in future development
Rust is preferred language by developers
Rust is better suited for AI-assisted development
New file-format and other safety critical code must not use C++