3 ms·
Ask HN: Is there a “simple C++” language trimmed down to something “modern”?
C++ seems to have a ton of stuff that you can probably ignore.
Over the years it seems to have accumulated cruft and never cleaned out the closet.
I wondered if maybe it was practical to create a new language by removing stuff from C++.
Does such a thing exist?
- bombcar 4y agoWhat do you mean by "like C++"? Something like C#? Rust? A modern object-oriented language?
- thesuperbigfrog 4y ago>> I wondered if maybe it was practical to create a new language by removing stuff from C++. What would be removed and why? The issue is that whatever is left would not be C++ and it would be difficult to get everyone to agree about what should be removed. Hyrum's law (https://www.hyrumslaw.com/ https://www.hyrumslaw.com/) also applies, so you can't remove anything without breaking things for someone. If you want a simpler, yet quite capable modern language, I would recommend Go (https://go.dev/ https://go.dev/). It might not replace C++ depending on your use case (for example: embedded programming or writing operating system drivers), but it is a good general purpose language that is easy to learn and easy to use.
- soulbadguy 4y agoI respectfully disagree. And as i pointed out in my other comment cpp_front and google carbon are trying to do just that. Bjarne is quoted to have said that there is a smaller C++ inside the current C++. As everything that was build buy gradual evolution, a clean reboot can converge on a "better" solution
- thesuperbigfrog 4y ago>> And as i pointed out in my other comment cpp_front and google carbon are trying to do just that. Cpp_front and Carbon are not C++. Parts of Cpp_front might become part of C++, but adding more stuff to C++ (usually increasing the overall complexity) has not been an issue for C++. That could be seen as part of the problem why C++ is so large and complex. By way of comparison, Carbon calls itself: "fundamentally a successor language approach, rather than an attempt to incrementally evolve C++." (https://github.com/carbon-language/carbon-lang https://github.com/carbon-language/carbon-lang) It aims to be a successor to C++, not the evolution of C++. >> Bjarne is quoted to have said that there is a smaller C++ inside the current C++. To officially be C++, the Standards Committee must agree to deprecate the features that give a smaller C++ in a future release of the C++ Standard. Good luck getting the C++ Standards Committee to agree on what to remove. >> a clean reboot can converge on a "better" solution Yes, but would it be backward compatible with existing C++ codebases? If the "clean reboot" is too different or not backward compatible enough would it be adopted by existing C++ users / the community? If it required significant effort to port old C++ code to the rebooted version, why would the rebooted version be chosen over another language?(for example: Rust, Go, Ada, Zig, etc.) Perl tried an ambitious rewrite from Perl 5 to Perl 6 and it did not work very well: it took too long, did not see wide adoption, and ultimately Perl 6 was renamed Raku. Perl did not have to push Perl 6 changes through a standards committee or try to get a dozen or more compiler implementors to agree. (https://en.m.wikipedia.org/wiki/List_of_compilers#C++_compilers https://en.m.wikipedia.org/wiki/List_of_compilers#C++_compil...) While it is possible that C++ could evolve into a smaller, cleaner version of itself, I do not think it is likely given all of the forces involved.
- everyone 4y agoC
- jlpcsl 4y agoSomething like C++ Core Guidelines can help with some focus: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
- soulbadguy 4y agoThere have been a lot of recent development around a "simpler c++". I think google carbon ( https://github.com/carbon-language/carbon-lang https://github.com/carbon-language/carbon-lang) and hurb sutter (https://github.com/hsutter/cppfront https://github.com/hsutter/cppfront) are probably the most advanced "proposal". Both languages are highly experimental and really far away from being production ready if ever. If you want/need something today, Dlang is pretty good. There are also a lot of other languages such Rust/Zig etc... which "somewhat" fit in the same niche as C++ but tend to have very different programming philosophy. Edit : Can't believe i left out Dlang, the OG better/simpler c++
- WhereIsTheTruth 4y agoD would be the answer https://dlang.org/ https://dlang.org/ Or: https://gist.github.com/bkaradzic/2e39896bc7d8c34e042b https://gist.github.com/bkaradzic/2e39896bc7d8c34e042b