2 ms·
how do languages which compile to machine code manage to implement these features in machine code? The answer is they don't. The machine code they generate may
by tigershark 10y ago
how do languages which compile to machine code manage to implement these features in machine code?
The answer is they don't. The machine code they generate may behave as if it were safe, but it's no more safe than any other machine code anywhere else, and no different.
At the end everything you write on a machine is translated to machine code and executed.
Or do you really believe that the CPU executes directly JavaScript?
Powerful type systems, HM inferences and all the other abstractions obviously don't exist at machine code level.
It's the resulting machine code that behave producing the behaviour of these abstractions.
Borrowing again your words:
Which means that it could just as well have been written that way to begin with because what's being enforced by the stricter language is idiom and style, not anything inherent to machine code itself.
I would say that it is obvious that you can write them directly in machine code and have the same effects.
Now how many people in the world do you think that believe it is a sane approach to manually write a complex application that uses powerful type systems directly in machine code?
I don't think you can find anyone outside a mental institution.
- krapp 10y ago>how do languages which compile to machine code manage to implement these features in machine code? The answer is they don't. The machine code they generate may behave as if it were safe, but it's no more safe than any other machine code anywhere else, and no different. Merely replacing "javascript" with "machine code" and pasting my comment back doesn't constitute a rational argument or an effective refutation of anything i've actually stated, it's the intellectual equivalent of a small bird mimicking human speech. >Now how many people in the world do you think that believe it is a sane approach to manually write a complex application that uses powerful type systems directly in machine code? Except... writing machine code does not describe writing javascript in any meaningful way. Machine code is low level, concrete, and not easily human readable. Javascript is high level and abstract. How sane is it to manually write a complex application that uses powerful type systems directly in machine code using C++? Why would you bother writing Java bytecode directly in Java source code? The metaphor of javascript as machine language breaks down so readily that, yes, I will question its utility, and whether fixating on it is pathological. If you don't like javascript as a language, fair enough - plenty of people don't, for valid reasons. I understand perfectly well why developers generate javascript from other languages and why they might find it useful to do so. But to hearken back to my original point, doing so doesn't affect javascript's relevance or discredit its quality as a language. You're still developing in javascript by proxy.