There is also a third way of doing this which is a bit of both. Instead of the compiled model where all the work is done upfront but can be a little bit inflexible or the interpreted model where all the work is done on the receiving end but can be a little bit slower, we can do half-and-half. we compile it part of the way to what's called an intermediate language, which takes it as far along the way to machine code as it can get while still being portable often across platforms.
You then distribute this, sending it to the people who need to run it, and each person who runs it takes it the last step to take it to machine code on their computers. This is sometimes referred to as Just-In-Time or JIT compilation. Now, this intermediate language sometimes also goes by the name of bytecode. So this process has to happen somehow. It's just how much of it happens on your machine and how much of it happens on mine. Now, while theoretically all computer languages could use any of these methods, the normal usage of any one language tends to be one or the other.