3 ms·
There kind of is. There's __cplusplus, which I'll grant you is quite janky. #IF __cplusplus==202302L
by kaz-inc 10mo ago
There kind of is. There's __cplusplus, which I'll grant you is quite janky.
#IF __cplusplus==202302L
- GeorgeTirebiter 10mo agoI'm wondering if the C++ -> Rust converters out there are part of the Solution: After converting C++ to Rust, then convert Rust to C++ and you now have clean code which can continue to use all the familiar tooling.
- aw1621107 10mo ago> I'm wondering if the C++ -> Rust converters out there are part of the Solution Are there C++-to-Rust converters? There are definitely C-to-Rust converters, but I haven't heard of anyone attempting to tackle C++. > After converting C++ to Rust, then convert Rust to C++ and you now have clean code which can continue to use all the familiar tooling. This only works if a hypothetical C++ to Rust converter converts arbitrary C++ to safe Rust. C++ to unsafe Rust already seems like a huge amount of work, if it's even possible in the first place; further converting to safe Rust while preserving the semantics of the original C++ program seems even more of a pie in the sky.
- GoblinSlayer 10mo agoPresumably you migrate to this Rustic++ version implying it's maintainable.
- aw1621107 10mo agoI'm not questioning what you do once you get to that hypothetical Rustic++. I'm questioning whether it's possible to get there using automated tooling in the first place.
- GeorgeTirebiter 10mo agoI think you have a point. Rustic++ won't be vibe-coded in a weekend.
- Someone 10mo agoThat checks whether a C++ compiler is used and, if so, for the version of the compiler, not whether “only modern c++ and libc++ existed inside it”. C++ compilers carry lots of baggage for backwards compatibility.