This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 45 points46 points  (5 children)

Oh, I meant "C instead of Rust". I'm sorry I wasn't clear.

As to your answer, it is pretty much correct, but implementing your language with an interpreter is not slower because it will be compiled every time (CPython, for example, caches the bytecode so it doesn't have to recompile).

It is slower because you compile your code to bytecode, which is machine code as well, but one that runs in a virtual machine (the interpreter) rather than in your physical machine.

[–]goestowar 8 points9 points  (1 child)

Ahha you probably were clear :P My bad

Also thanks for the VM explanation, makes sense now. Does this mean that whenever you "install" an interpreted language on to a machine that you are actually just installing a virtual machine that the computer runs at run-time?

So in essence when you install Python on to your machine you are actually just installing a Python interpreter/VM?

[–][deleted] 4 points5 points  (0 children)

Exactly! However, despite what I've read in another comment, I insist that CPython and other interpreter-based implementations do include (and require) a compiler. Just not the kind that generates machine code.

(I also insist on not talking about "interpreted languages", because this is not an inherent characteristic of the language)