6 ms·
The volume of existing C, C++, Objective-C, and C# code is phenomenal. Even if this strategy is generally adopted there will continue to be lots of this legacy
by m0llusk 4y ago
The volume of existing C, C++, Objective-C, and C# code is phenomenal. Even if this strategy is generally adopted there will continue to be lots of this legacy code for many years to come. In particular there will continue to be such legacy code right up until 2038 at least.
- solomatov 4y agoThe old C/C++ and other code in popular languages is forever with us. Look at what happened to COBOL, it's still relevant and IMO, will be relevant in 20 years.
- synergy20 4y agocarbon, and the newly announced alpha stage efforts called cppfront, can potentially act as a "typescript" for c++, new compiler can enforce memory safety at an upper layer before they're converted to c++, maybe there is hope for c/c++ code for years to come as long as they keep fixing issues along the way.
- solomatov 4y agoHaving written enough Rust code, I could bet that it won't be an easy task to rewrite C/C++ code with a borrow checked language. You just need to write code differently for this approach to work.
- sseagull 4y agoThis is kind of the argument though. People are likely to migrate existing code if it’s easy enough. If they have to rewrite the whole thing, then it’s not often going to be done.
- kllrnohj 4y agoIs anyone attempting to do the same with C though? Carbon & cppfront, if successful, would only "save" C++. C would still be left out to dry. Then again, the C committee is also pretty much phoning it in and has been for quite a while now.
- sanxiyn 4y agoYes. Microsoft Research is working on "Checked C": https://www.microsoft.com/en-us/research/project/checked-c/ https://www.microsoft.com/en-us/research/project/checked-c/ As a test, someone ported FreeBSD's networking stack to Checked C. It was easy and there was no overhead to performance and binary size.
- kllrnohj 4y agoThat's pretty interesting. It really undersells itself in the intro description where it sounds something more like clang's ubsan -fsanitize=bounds, but in actuality it's adding other features as well including generics. Although that said, it's somewhat odd that memory lifetime is entirely ignored by it. All the changes seem to be laser focused on bounds checks and bounds checks only (with generics being to eliminate `void*` specifically so that, you guessed it, bounds checking can be done)
- imron 4y ago> Is anyone attempting to do the same with C though? Absolutely. In fact cfront preceded cppfront by many years ;-)
- Gigachad 4y agoThere is still shitloads of COBOL code in use. And we still consider it depreciated and not suitable for new projects.
- 13of40 4y ago"for those scenarios where a non-GC language is required" C# code is out of scope for this discussion.
- quickthrower2 4y agoSure
- CameronNemo 4y agoEven more of a reason to implore a moratorium immediately.