5 ms·
I appreciate the work here, and I'll remember this when I need it, but C++ is long past gross. Enough already, the committee needs to be less prideful and just
by ezy 11y ago
I appreciate the work here, and I'll remember this when I need it, but C++ is long past gross.
Enough already, the committee needs to be less prideful and just add complete macros/metaprogramming to the language already in C++14 and let apparently smart programmers who can disentangle variadic type templates to stop wasting brainpower and valuable time doing that and just write the compile-time transformations they want to have happen.
- jokoon 11y agoThere are not so many language who can directly compile and optimize to machine code though. I'm not sure if java or C# can easily jit to have something that is close to machine code. Anyway having machine code directly (and no need for VM) is useful if you want to reduce the overhead and fully exploit your hardware. Surely it's not for students or for casual programmers, but it has a use.
- nabla9 11y agoIt would be easier to just design better language that compiles into C++ and can use existing libraries than continue with C++.
- blywi 11y agoIronically this is exactly how C++ itself started out: With a compiler that compiles C++ code into C. https://en.wikipedia.org/wiki/Cfront https://en.wikipedia.org/wiki/Cfront
- pldrnt 11y agoIncidentally, this is exactly what I am working on, grammar and parser are mostly done (the grammar is _regular_ and programs can rewrite themselves starting from their AST, because I really want something like `go fmt` one day), doing the transpiler at the moment, it's... interesting to say the least. (it will be foss of course but nothing is published yet)
- nikbackm 11y agoUse existing C++ (template) libraries? Does not seem that easy to me, seems that would impose quite a bit of complexity on the new language.
- skimpycompiler 11y agoYeah, not all features of C++ are for students. But writing highly efficient code if one's aware of the copy-move semantics is almost straightforward. I can't remember when some larger projects rewritten in C++ turned out to be slower. Build tools, developing tools are superior to those 10 years ago, and the compiler(s) is still the best optimizer there is for production code. Working in C++ today is easy. I sometimes feel a bit strange when I find that I'm oblivious about some hardships C++ developers had in the past, and today I didn't even know you can do it the hard way.
- anon4 11y agoYou can actually easily (compared to some time ago) write your own language to do that via the power of LLVM. You'll also be able to produce object files that can be linked in C/C++ programs, if you wish. Edit: Or, you know, write a different macro preprocessor for C++. There's nothing special about the standard CPP other than coming bundled with the compiler.