3 ms·
Suppose you're a big company with a ton of C++ code. You're never going to rewrite it all. It wouldn't even be a good idea. If only there were a way to write
by MathMonkeyMan 4y ago
Suppose you're a big company with a ton of C++ code. You're never going to rewrite it all. It wouldn't even be a good idea.
If only there were a way to write new code in a new language, mostly unconstrained by the long history of C++, but let the two languages share a toolchain, and maintain a logical interface compatibility layer. Not just linking the same ABI, but compatible types, functions, meta-functions (templates), etc.
Then you could implement all of the features and static checks of your dreams, and modify the language and its implementation to make those features/checks more powerful and easy to implement.
My guess is that's the idea. If you weren't a huge company with zillions invested in countless lines of C++, you wouldn't need to consider this. And, regardless, it's a neat idea.
- MBCook 4y agoThere was a very interesting presentation about how Apple was trying to give Swift a stable ABI that provided forward looking stability. Apple has a LOT of C/C++/Obj-C/Obj-C++ code. And they certainly have the resources/need for such a thing. I wonder if what they’re doing could be extended to make integrating new Swift code easier with all the existing non-Swift stuff as it slowly got rewritten. I’m not suggesting everyone switch to Swift, merely that someone may already be doing something like you’re talking about.
- pjmlp 4y agoThey not only were trying, they made it, it was made stable in Swift 5.
- humanrebar 4y agoYeah, but doesn't that approach presume you have a monorepo or something already? Seems like converting a native python extension to the new language will just break all the downstream users of that package who do not already have the new toolchain set up. That's exactly what happened with the cryptography package when it converted to Rust. And that's just an example. What about all the projects shipping to embedded systems, tiny Linux distros, specialty proprietary OSs, and so on?