3 ms·
> Normally, an interpreter is a complete alternative to a compiler. Yes, that would be the Bill Gates MS Basic or Forth sense of interpreter. But it wouldn't b
by CalChris 9y ago
> Normally, an interpreter is a complete alternative to a compiler.
Yes, that would be the Bill Gates MS Basic or Forth sense of interpreter. But it wouldn't be the post parsing, here's an AST, now what do we do with it sense. If they called V8 an interpreter (they call it an engine) I could see that although it would still seem archaic usage. But they're stitching Ignition on the side of V8 and calling that an interpreter which is just strange.
> The bytecode binary runs without modification on multiple hardware platforms. It's pretty reasonable to call that an abstraction of machine code.
No, that's portability onto multiple platforms. But the article said Bytecode is an abstraction of machine code. 'Abstraction of' vs 'runs on', these are two very different concepts.
- dahart 9y ago> Yes, that would be the Bill Gates MS Basic or Forth sense of interpreter. But it wouldn't be the post parsing, here's an AST, now what do we do with it sense. It's also the JavaScript, Python, Haskell, Perl, Ruby, bash, etc. etc. etc. sense of the word interpreter. You can use it to describe all languages that aren't compiled. You said interpreters "interpret bytecode". You claimed that a bytecode interpreter was the broadest definition of interpreter, and that saying the interpreter is what reads source JavaScript and turns it into bytecode was wrong. I disagree, and Wikipedia does too. Many, perhaps even most interpreters don't even involve bytecode at all. You're entitled to your opinion, but I guess just expect some pushback if you're going to try to correct people using your narrow, uncommon idea of what makes an interpreter. > No, that's portability onto multiple platforms. Normally when I'm talking about code with other people, "portable" means code you can re-compile for a platform, not that the binary runs without modification. But, sure, I'd agree that it's reasonable to call bytecode a mechanism for portability. The way it does that is by abstracting away a specific platform's assembly language in favor of one that runs on multiple platforms. People call programming languages like C & Python an abstraction of machine language. JavaScript's bytecode is just that - it's a low level programming language. And as such, it's abstracting the hardware. Virtual machines are an attempt to abstract the CPU specifics and have code that runs anywhere. > 'Abstraction of' vs 'runs on', these are very different concepts. I don't know what your definition of abstraction is, but based on your objections, it feels like you have a narrow and rigid idea that perhaps doesn't match the common usage. A function that takes a parameter is an abstraction of a block of code, just like any programming language that runs on multiple platforms is an abstraction of a specific CPU or machine language.
- CalChris 9y agoSICP uses a John Locke quote to define abstraction: The third is separating them from all other ideas that accompany them in their real existence: this is called abstraction Oxford says: Freedom from representational qualities in art. You can't say that and then at the same time say, oh and it fits in a byte. You can't say that a function abstracts some code. You could say that an interface abstracts a module. Or as Principles of Computer System Design says: The separation of the interface specification of a module from its internal implementation so that one can understand and make use of that module with no need to know how it is implemented internally BTW, Wikipedia is awesome but I'm hella not going to take their description on this. H+P, SICP, DragonBook, ... some primary source but not Wikipedia. The above mentioned POCSD says: The abstraction that models the active mechanism performing computations. An interpreter comprises three components: an instruction reference, a context reference, and an instruction repertoire. MS-BASIC doesn't fit that definition.
- dahart 9y agoHey I'm sorry you didn't like the article. I hope you can find some reading you do like, and comment on that instead. I love SICP, but I feel like you mistook an example of one kind abstraction as the definition of all abstraction. A function does abstract code. A programming language does abstract machine language. If you feel otherwise, good for you, but you've confirmed my suspicion that your definition is far removed from common usage. I hope that helps you understand all the pushback on your first comment, but otherwise I have nothing else to add. I don't want to argue over what abstraction is, we are already too far away from any specifics that matter.
- CalChris 9y agoThanks. I follow V8+WASM sort of closely and there are things I like there. But the Iron Rule of HN is that if you criticize, you will suffer! That's OK. I think it's important every once in awhile to plant your flag in the ground and make sure you can defend it; not to the point of trolling but do I really understand my opinion. I'll admit that my notion of interpreter is perhaps historically limited and that there have been others. In any case, I appreciate the back and forth. I learned things.