That might work on Windows. But keep in mid that LLVM isn't as optimized for Windows as it is for other OSs. Jai is also a specialized language seems to be simple to convert to C. Converting C++ isn't as easy and my suspicion is that C++ -> C -> MSVC would not come out on top of Clang -> LLVM. Additionally you need to consider the optimizations you can apply when converting to IR. Converting to C by itself is not really useful if you don't use the language specific knowledge (for example knowledge of the standard library) to optimize in that step.
Converting to C by itself is not really useful if you don't use the language specific knowledge (for example knowledge of the standard library) to optimize in that step.
Are c++ compilers doing that? I had the impression that they treat STL code just like any other code.
Since a long time all major C++ compilers are compiling C++ directly. Only the fisrt compilers were translating C++ to C (for faster implementaton with then existing C compilers), today it would be a waste of a lot of information.
2
u/pine_ary May 10 '20
That might work on Windows. But keep in mid that LLVM isn't as optimized for Windows as it is for other OSs. Jai is also a specialized language seems to be simple to convert to C. Converting C++ isn't as easy and my suspicion is that C++ -> C -> MSVC would not come out on top of Clang -> LLVM. Additionally you need to consider the optimizations you can apply when converting to IR. Converting to C by itself is not really useful if you don't use the language specific knowledge (for example knowledge of the standard library) to optimize in that step.