3 ms·
> Why do I want a transpiler to take C23 code and convert it down to C99 code? Because you are required to use Visual Studio or some compiler that barely even
by cryptonector 4y ago
> Why do I want a transpiler to take C23 code and convert it down to C99 code?
Because you are required to use Visual Studio or some compiler that barely even does C99/C11.
> If I was interested in using the C23 features, wouldn't I use a C23-ready compiler?
Yes, but maybe you can't guarantee a C23-capable compiler on all the platforms you care about, or maybe you are required to support VS/VC.
> That said... I do wonder how long it will be until ARM and GCC have a C23 toolchain - or did I just answer my own question?
You did :)
Transpiling is just a very useful idea. Sure, why even bother, the world should be perfect already! But the world isn't. And anyways, transpiling is a very cool idea. If you have time and funding (e.g., maybe you're a graduate student), then you might build it. If you don't have the time and funding you might wonder why even bother, except maybe you have the need and then you get the funding? Even if you don't have the time or funding, you might make an idea you care about into a hobby. So there's many reasons why one might want to build a transpiler.
In another thread we were talking about transpilers for SQL. There the motivation is much stronger and clearer than here, but it's of the same sort: portability. In the case of SQL there's so much variation across RDBMSes that if you must support more than one, you'll quickly wish you had a transpiler for some dialect, or even for an alternative query language.
Another thing is that a transpiler won't need to do much analysis or optimization, so it can be fairly simple compared to a full compiler, but! a transpiler can be much less ambitious than -and a great starting point for- constructing a compiler.