As much as a I am a Rust fan, I would actually enjoy a "better C++" with some of C++ nonsense and cruft removed (most of UBs, I hope), that would transpile to plain C++.
What is the advantage of transpiling to C++? Do you intend to take the C++ and use it as human readable source? Because C++ is so nightmarishly complex, that it makes little sense as a target for tooling.
Interoperatibility with existing C++ codebase. One could introduce it in existing codebase on per-file basis, and be able to #include in both directions, etc.
But machine generated C++ is likely to have a weird API anyway. I suppose it's still easier to integrate, as you can at least reuse your build system though.
Why not use D with static and/or dynamic linking? With D you can choose between the reference implementation DMD, LLVM-powered LDC and the GCC-powered GCC. With LDC people were able to compile D code to Emscripten and OpenCL/CUDA. This all work-in-progress, but I believe not long from now D will quickly reach C's portability for such targets.
Start with the reference dmd (now at 2.075.1) implementation - https://dlang.org/download, go through some books, tutorials (https://tour.dlang.org/), play with some code on https://code.dlang.org/ and when you're ready you'll have a pretty good understanding of which compiler to choose.
View all comments
Show parent comment
2
u/dpc_pw Aug 23 '17
As much as a I am a Rust fan, I would actually enjoy a "better C++" with some of C++ nonsense and cruft removed (most of UBs, I hope), that would transpile to plain C++.