3 ms·
I agree with the first part, disagree with the second. "JavaScript is assembly" is, in my estimation, usually a rather blase metaphor for the idea of JavaScript
by Cushman 14y ago
I agree with the first part, disagree with the second. "JavaScript is assembly" is, in my estimation, usually a rather blase metaphor for the idea of JavaScript as a compile target. People don't say "JavaScript is the new C" because generally you don't target C. (Generally you don't target assembly, either, but the distinction between assembly and machine code is academic to most people.)
And it's no surprise that we're getting lost in this; making arguments based on metaphors rather than the thing itself is a classic trap. We should make an effort where possible to talk about what JavaScript is rather than what it "is".
- scott_s 14y agoI guess it depends on how general you mean "generally" to be, but there is a history of people targeting C for new and experimental languages. It's a convenient target because we have a good idea of what kind of assembly will be created for a given chunk of C, and you can get architecture independence for free.
- Cushman 14y ago> and you can get architecture independence for free And you target JavaScript for precisely the same reason :) Perhaps the better way to say it is this: C is a language which was once written by hand, but which is increasingly being used as a target for higher-level languages. The same thing is happening to JS, but at least to me "JavaScript is the new C" is not a particularly useful way to express that similarity.
- vidarh 14y ago> because generally you don't target C. (Generally you don't target assembly, either, but the distinction between assembly and machine code is academic to most people.) You're excluding a large chunk of compilers with those two generalizations. Targeting assembly rather than directly emitting machine code is extremely common (gcc being one of the obvious examples), and targeting C is very common for new/experimental languages.
- Cushman 14y agoAll I'm trying to say is that "a target for higher-level languages" is not a defining attribute of C in a way that makes "JavaScript is the new C" a helpful analogy.
- deleted 14y ago[deleted]
- fauigerzigerk 14y ago"making arguments based on metaphors rather than the thing itself is a classic trap" Well, yes and no. I do agree that it often goes completely wrong and can be very misleading. But the JavaScript/assembly argument is more an analogy than it is a metaphor, and analogies are a very important function of intelligence and a tool for making important discoveries. That said, I like your generalization "compile target" a lot more than calling JavaScript assembly.
- epsylon 14y agoThere are a lot of compilers that target directly C.