Re:It's time to halt starting any new projects in C/C++
by synergy20 on Monday September 19, 2022 @10:10PM
(#32906823)
carbon, 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.
[ Parent
| on HN ]
Re:It's time to halt starting any new projects in C/C++
by kllrnohj on Monday September 19, 2022 @10:33PM
(#32906995)
Is 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.
Re:It's time to halt starting any new projects in C/C++
by sanxiyn on Monday September 19, 2022 @10:56PM
(#32907142)
Yes. Microsoft Research is working on "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.
Re:It's time to halt starting any new projects in C/C++
by kllrnohj on Tuesday September 20, 2022 @08:30AM
(#32910769)
That'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)
Re:It's time to halt starting any new projects in C/C++
by imron on Monday September 19, 2022 @11:28PM
(#32907327)
> Is anyone attempting to do the same with C though?
Absolutely. In fact cfront preceded cppfront by many years ;-)
Re:It's time to halt starting any new projects in C/C++
by solomatov on Monday September 19, 2022 @10:15PM
(#32906860)
Having 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.