by something123 · 11y ago · 0 comments
You could:
- prevent people from using deprecated features
- immediately remove TONS of boilerplate
- automatically generate header files from the cpp's
- have high level keywords that would generate design patterns for you (no more having to re-implement a Visitor for the first time that year and having to spend a day debugging it)
At the same time you could still leverage C++ libraries and when you do need to write an allocator or do some fancy diamond inheritance friend method templating magic shenanigans you could always drop back down to C++
EDIT: What I find kind of amusing is that with time you can do more and more of these things through Visual Studio's magical "wizards" and checkboxes (maybe it's the same for the other IDEs.. not sure), but ofcourse it's rather silly, clunky and slow to use. In the latest version you can finally make matching declarations/definitions with a couple of clicks - saves a lot of the mildly frustrating copy/past'ing!
OTOH if you are really after C++ but done right then that would be D http://dlang.org
If you wish something like this for C then I would likely point to Nim.
As for library and tool support, I think a safe subset of C++ couldn't actually use tools for "real" C++, because the languages would be too different.
Yes, maybe Rust is better, and maybe if we could push a button and make everyone use it the world would be a better place.
But the reality is that there are very few code bases written in Rust and an uncountable amount written in C++ - there are decades of work behind C++ and decades of work will still be done in C++. I need to earn a living TODAY and work in the current reality, and I need tools to help me be more productive. I can't wait 5 years for some brand new language to take over.
In the end though I never had enough time to bring it to a usable state, it was just a toy project for me to play around with waf-build and boost.test.
It doesn't compile to C++, but directly to machine code.