Supporting Rust is inevitable for platforms that want to remain viable for modern software releases
Supporting Rust is inevitable for platforms that want to remain viable for modern software releases
Posted Nov 25, 2024 18:48 UTC (Mon) by khim (subscriber, #9252)In reply to: Supporting Rust is inevitable for platforms that want to remain viable for modern software releases by pbonzini
Parent article: NonStop discussion around adding Rust to Git
> Is anybody using reflexpr in production?
I don't know. It's not yet available in a stable form, anyway.
But with C++20 you already have pretty decent reflection: could count number of fields in a struct (here's an explanation about how that could be achieved), enumerate enums, deal with various pointers to functions, etc.
But the most useful ability is simple std::is_same_v, which allows you to look on the type and do something special for one type or another. Incredibly useful in so many places when combined with if constexpr. And incredibly awkward in Rust.
Sure, but that requires the maker of these types to think about that need. There are also #test which solves another issue that many other languages handle via reflection.
This covers around 90% of usecases and actually make Rust tolerable, sure.
But the remaining 10% of usecases still exist.
Posted Dec 5, 2024 21:53 UTC (Thu)
by ssokolow (guest, #94568)
[Link]
Serde does have a workaround for "remote types" and, beyond that, you're bumping up against intentional Rust design decisions relating to API stability.
Supporting Rust is inevitable for platforms that want to remain viable for modern software releases
Sure, but that requires the maker of these types to think about that need.
That depends on what you mean by "think about that type of need".
