How then do the compilers know when to use these special extensions? Also, like the Windows object loader, how does VMS handle the decision to know which code blocks to use which are supported by the current h/w and which CPU extensions are available at runtime?
What Javascript is in programming language space, x86 architecture is in processor architecture space. It should have never happened. Both are horrible, but got popular for pure legacy reasons.
I don't like javascript, but what is "horrible" with it? Many people find any language that is radically different from what you are used to "horrible". Today, most people are grown up with C/C++ or java. To an old man like me, that's horrible, especially the strange == && | | syntax. I find the basic x86 assembly language pretty simple and natural, and very similar to older computers, only so much faster. But I agree that all add ons during the 1990s and 2000s have made it immensely complex, and some of them are ugly. As I see it, software compatibility should no be based on a specific processor instruction set, but on a few standard p-code formats (or "bytecode" as they say today) that can be supported (implemented) on numerous different machines without to much work.