below i will provide to you the transcription of a video lesson called " Compiled and interpreted languages".. Study the content of it, find the meaning the speaker wants to convey and create a text, a lesson that will convey this meaning in an easy to understand way to college students new to the subjects discused in it. this is the transcript : ""1
00:00:00,000 --> 00:00:04,990
So we need to get our source code converted into machine code somehow before it

2
00:00:05,000 --> 00:00:09,990
can run and there are two main ways of doing this: what's called compiling the

3
00:00:10,000 --> 00:00:13,990
source code and what's called interpreting the source code.

4
00:00:14,000 --> 00:00:16,990
Now luckily, this is not a big decision you have to worry about.

5
00:00:17,000 --> 00:00:21,990
Most languages you'll deal with will naturally fall into one or the other, but

6
00:00:22,000 --> 00:00:22,990
it is worth knowing the difference.

7
00:00:23,000 --> 00:00:24,990
So let's have a simple scenario.

8
00:00:25,000 --> 00:00:30,990
Let's say it's just you and me. You have your computer and I have my computer

9
00:00:31,000 --> 00:00:34,990
and you're going to write a program that you want me to run.

10
00:00:35,000 --> 00:00:38,990
Now, with a compiled language, what happens is you write your source code and

11
00:00:39,000 --> 00:00:42,990
then you have a program called a compiler that will go through that source code

12
00:00:43,000 --> 00:00:48,990
and create a separate file that contains the machine code, and you just give me that file.

13
00:00:49,000 --> 00:00:53,990
This end result is sometimes referred to as an executable or an executable file

14
00:00:54,000 --> 00:00:55,990
because I can directly execute it.

15
00:00:56,000 --> 00:00:57,990
I can now just run your program.

16
00:00:58,000 --> 00:01:01,990
You keep your source code and I never see it.

17
00:01:02,000 --> 00:01:05,990
Now, with an interpreted language on the other hand, you don't compile your

18
00:01:06,000 --> 00:01:08,990
source code beforehand. You just give me a copy of it.

19
00:01:09,000 --> 00:01:14,990
So I'll need my machine to interpret it whenever I want to run your program.

20
00:01:15,000 --> 00:01:17,990
Now, interpreter is different to a compiler.

21
00:01:18,000 --> 00:01:18,990
It does this on-the-fly.

22
00:01:19,000 --> 00:01:22,990
We can think of it as going through your source code line by line and

23
00:01:23,000 --> 00:01:23,990
processing it on the spot.

24
00:01:24,000 --> 00:01:27,990
It does not save it as a separate machine code file.

25
00:01:28,000 --> 00:01:31,990
Now, you've used interpreted languages even if you don't know it.

26
00:01:32,000 --> 00:01:34,990
Whenever you've looked at a webpage with JavaScript, which if you've surfed

27
00:01:35,000 --> 00:01:39,990
the web for more than two minutes in your lifetime you have, this is what's been happening.

28
00:01:40,000 --> 00:01:43,990
The JavaScript has been sent to you over the web along with a bunch of other

29
00:01:44,000 --> 00:01:48,990
files like webpages and images and it's been sent as source code onto your

30
00:01:49,000 --> 00:01:54,990
machine, and your web browser has just interpreted that JavaScript so it can run that code.

31
00:01:55,000 --> 00:01:55,990
So which one is best?

32
00:01:56,000 --> 00:01:58,990
Well, they both have their good and their bad points.

33
00:01:59,000 --> 00:02:00,990
Benefits of compiled code.

34
00:02:01,000 --> 00:02:04,990
Once it's compiled, it's immediately ready to run and you could send it to 100

35
00:02:05,000 --> 00:02:08,990
or 1,000 or 100,000 different people. It's ready to go.

36
00:02:09,000 --> 00:02:13,990
It can be optimized for a CPU, so it can actually be faster and you don't have

37
00:02:14,000 --> 00:02:17,990
to send your source code to everybody, which might be a good thing.

38
00:02:18,000 --> 00:02:22,990
However, the downsides are if I compile it on a PC, that executable file

39
00:02:23,000 --> 00:02:24,990
won't work on a Mac.

40
00:02:25,000 --> 00:02:28,990
In fact, it often needs to be compiled separately for different kinds of CPU

41
00:02:29,000 --> 00:02:33,990
even on the same platform, and when you're writing code to compile is an extra

42
00:02:34,000 --> 00:02:37,990
step that you have to take every time you want to test your program.

43
00:02:38,000 --> 00:02:41,990
Now, with interpreted code, the big benefits are I don't really care what kind

44
00:02:42,000 --> 00:02:45,990
of machine is on the other end, because we don't provide machine code.

45
00:02:46,000 --> 00:02:49,990
We just send the source code and we let the other side take care of it.

46
00:02:50,000 --> 00:02:53,990
So it can be more portable and more flexible across platforms.

47
00:02:54,000 --> 00:02:57,990
It's also a little easier when testing because you just write your source code

48
00:02:58,000 --> 00:03:00,990
and then run it, letting the interpreter take care of converting it.

49
00:03:01,000 --> 00:03:04,990
There is no in-between compile step.

50
00:03:05,000 --> 00:03:08,990
It can be easier to debug when things go wrong because you always have access to

51
00:03:09,000 --> 00:03:09,990
all the source code.

52
00:03:10,000 --> 00:03:13,990
However, it has its down sides too, because everyone who needs to run that

53
00:03:14,000 --> 00:03:18,990
program on their machine has to have an interpreter for that language on their machine.

54
00:03:19,000 --> 00:03:22,990
It also can be slower because you have to interpret it every time the program is run,

55
00:03:23,000 --> 00:03:26,990
and the source code is effectively public because you're sending it to

56
00:03:27,000 --> 00:03:28,990
everyone who needs to run that program.

57
00:03:29,000 --> 00:03:33,990
Now, because there are good things about compiled languages and good things

58
00:03:34,000 --> 00:03:38,990
about interpreted languages, there is also a third way of doing this which is a bit of both.

59
00:03:39,000 --> 00:03:43,990
Instead of the compiled model where all the work is done upfront but can be a

60
00:03:44,000 --> 00:03:48,990
little bit inflexible or the interpreted model where all the work is done on the

61
00:03:49,000 --> 00:03:54,990
receiving end but can be a little bit slower, we kind of do half-and-half.

62
00:03:55,000 --> 00:03:59,990
Upfront, we compile it part of the way to what's called an intermediate

63
00:04:00,000 --> 00:04:03,990
language, which takes it as far along the way to machine code as it can get

64
00:04:04,000 --> 00:04:06,990
while still being portable often across platforms.

65
00:04:07,000 --> 00:04:11,990
You then distribute this, sending it to the people who need to run it, and

66
00:04:12,000 --> 00:04:16,990
each person who runs it takes it the last step to take it to machine code on their computers.

67
00:04:17,000 --> 00:04:20,990
This is sometimes referred to as Just-In-Time or JIT compilation.

68
00:04:21,000 --> 00:04:25,990
Now, this intermediate language sometimes also goes by the name of bytecode.

69
00:04:26,000 --> 00:04:28,990
So this process has to happen somehow.

70
00:04:29,000 --> 00:04:33,990
It's just how much of it happens on your machine and how much of it happens on mine.

71
00:04:34,000 --> 00:04:39,990
Now, while theoretically all computer languages could use any of these methods,

72
00:04:40,000 --> 00:04:43,990
the normal usage of any one language tends to be one or the other.

73
00:04:44,000 --> 00:04:49,990
So for example, C, C++, and Objective-C, these are typically found as compiled

74
00:04:50,000 --> 00:04:51,990
languages, so you need a compiler.

75
00:04:52,000 --> 00:04:55,990
Now the compiler can be downloaded for free but they're often built into

76
00:04:56,000 --> 00:04:58,990
integrated development environment applications.

77
00:04:59,000 --> 00:05:03,990
Now, languages like PHP and JavaScript and indeed most languages with the word

78
00:05:04,000 --> 00:05:10,990
script at the end are usually interpreted, and languages like Java, C#, VB.NET,

79
00:05:11,000 --> 00:05:14,990
and Python use this intermediate hybrid approach.

80
00:05:15,000 --> 00:05:19,990
Now, whether a language is compiled or interpreted or somewhere in-between is

81
00:05:20,000 --> 00:05:23,990
rarely a reason by itself to choose a language, but it can be something that

82
00:05:24,000 --> 00:05:24,990
you take into account.

83
00:05:25,000 --> 00:05:30,990
If one main priority of your program is absolute maximum speed running on one

84
00:05:31,000 --> 00:05:34,990
single platform, you'll probably look at a compiled language.

85
00:05:35,000 --> 00:05:38,990
If you're more interested in easily moving your code across multiple platforms,

86
00:05:39,000 --> 00:05:41,990
you're probably more interested in an interpreted one.

87
00:05:42,000 --> 00:05:45,990
But more usually, you're driven more by what you need to do.

88
00:05:46,000 --> 00:05:49,990
You need to build iPhone apps or Windows desktop apps or dynamic website,

89
00:05:50,000 --> 00:05:54,990
or, in our case, just learn the fundamentals of programming, and you let that

90
00:05:55,000 --> 00:05:58,990
decision drive the language choice and the language choice will determine

91
00:05:59,000 --> 00:06:09,000
whether you are compiled, interpreted, or somewhere in the middle.