Re:Why people think C++ is complicated?
by xamuel on Thursday July 02, 2015 @12:11PM
(#9819825)
You're right. I think someone else already pointed out asm.js as a good example.
Of course, it won't happen magically: someone has to go to the effort of defining the subset and building the compiler for it.
You can't expect the general-purpose compiler to automatically be as optimal as possible just because a program happens to use the subset. For example, the program might be being compiled into something like a java .class file meant for importing to a less conservative calling program. This would be incompatible with putting those bare metal optimizations in the .class file.
Of course, it won't happen magically: someone has to go to the effort of defining the subset and building the compiler for it.
You can't expect the general-purpose compiler to automatically be as optimal as possible just because a program happens to use the subset. For example, the program might be being compiled into something like a java .class file meant for importing to a less conservative calling program. This would be incompatible with putting those bare metal optimizations in the .class file.