4 ms·
There 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 i
by jokoon 11y ago
There 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.