Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,170 --> 00:00:06,030
Almost everyone that has worked with JavaScript has heard of the V8 engine.
2
00:00:06,300 --> 00:00:13,020
The idea of the JavaScript engine, and most people know that JavaScript is a single threaded language,
3
00:00:13,380 --> 00:00:15,440
that it uses a callback.
4
00:00:15,690 --> 00:00:20,460
You may also hear phrases like JavaScript is an interpreted language.
5
00:00:21,060 --> 00:00:24,120
Let's tackle what that means over the next couple of videos.
6
00:00:24,420 --> 00:00:27,120
What is this engine that we speak of?
7
00:00:27,660 --> 00:00:35,940
Well, if I write some code like, let's say cost is happy equals to true.
8
00:00:37,160 --> 00:00:39,260
Well, we just wrote some JavaScript.
9
00:00:39,500 --> 00:00:44,390
I'm assigning the true boolean to the variable is happy.
10
00:00:44,810 --> 00:00:49,640
Now how do we read this or how does the computer read this?
11
00:00:50,700 --> 00:00:56,220
Imagine if somebody comes up to you and gives you a computer and they tell you, hey, tell this computer
12
00:00:56,220 --> 00:00:59,100
to display a picture of horses on the screen.
13
00:00:59,910 --> 00:01:07,500
And you start looking at this computer and you tell the computer to display an image of a horse or horses
14
00:01:07,500 --> 00:01:08,340
in French.
15
00:01:08,670 --> 00:01:10,590
Is the computer going to understand you?
16
00:01:11,280 --> 00:01:11,700
No.
17
00:01:11,700 --> 00:01:14,250
The computer would have no idea what you just said.
18
00:01:14,970 --> 00:01:20,490
In similar fashion, if I gave a computer with a CPU.
19
00:01:21,430 --> 00:01:23,620
A file that is a JavaScript file.
20
00:01:24,620 --> 00:01:27,650
And I tell it, hey, read this file and do something for me.
21
00:01:27,770 --> 00:01:32,330
Well, the computer only understands ones and zeros at the end of the day.
22
00:01:32,870 --> 00:01:38,840
And when we give it the JavaScript file, it's like me talking to a computer in French and the computer
23
00:01:38,840 --> 00:01:40,540
being like, What?
24
00:01:40,550 --> 00:01:41,570
What are you talking about?
25
00:01:42,020 --> 00:01:46,670
Plus, talking to a computer in French while people are going to look at you like you're a crazy person.
26
00:01:46,970 --> 00:01:51,500
So the computer doesn't really know what JavaScript is.
27
00:01:51,800 --> 00:01:59,300
So how are we able to communicate using a JavaScript file so that the computer displays pictures of
28
00:01:59,300 --> 00:01:59,930
horses?
29
00:02:01,080 --> 00:02:05,580
And this is the first step in our learning, and that is the JavaScript engine.
30
00:02:05,880 --> 00:02:13,830
By having a JavaScript engine right over here, it allows you to give this machine the JavaScript file,
31
00:02:14,070 --> 00:02:21,120
and this machine is going to understand this file and tell the computer what to do to display pictures
32
00:02:21,120 --> 00:02:21,930
of horses.
33
00:02:22,320 --> 00:02:28,590
In a sense, you just created a translator so you can communicate with somebody that doesn't know your
34
00:02:28,590 --> 00:02:29,250
language.
35
00:02:29,880 --> 00:02:35,670
And this special engine called the JavaScript engine understands JavaScript.
36
00:02:36,800 --> 00:02:42,570
Our computer finally understands us because of this JavaScript engine and it says, I'm on it, boss.
37
00:02:42,590 --> 00:02:44,780
I'll start displaying those horse pictures.
38
00:02:45,870 --> 00:02:46,550
There you go.
39
00:02:46,560 --> 00:02:47,910
That's our first step.
40
00:02:48,180 --> 00:02:52,620
And over the next couple of videos, we're going to talk about exactly what's happening inside.
41
00:02:52,950 --> 00:02:57,090
But do you think there's one JavaScript engine or many JavaScript engines?
42
00:02:58,700 --> 00:03:06,620
Well, as you can see from this Wikipedia list, there are a ton of engines and they're called xma script
43
00:03:06,620 --> 00:03:07,130
engines.
44
00:03:07,130 --> 00:03:08,990
And we'll get into why that is later.
45
00:03:08,990 --> 00:03:15,950
But these are all the JavaScript engines, some of them you may have heard of like V8 or spider monkey
46
00:03:15,950 --> 00:03:17,000
or chakra.
47
00:03:17,390 --> 00:03:22,850
So any time we use an engine, we're able to give it a JavaScript file.
48
00:03:22,850 --> 00:03:28,970
And this JavaScript file gets understood by the engine, and it allows this engine to communicate and
49
00:03:28,970 --> 00:03:35,390
tell the machine, the computer, to do what we ask it to do with JavaScript.
50
00:03:36,560 --> 00:03:39,910
Now these engines are written by programmers.
51
00:03:39,920 --> 00:03:43,790
For example, V8 engine is written in C++.
52
00:03:44,150 --> 00:03:47,090
But why do people write these engines?
53
00:03:47,180 --> 00:03:55,700
2008 marked a really pivotal moment in history when it comes to JavaScript because V8 was released by
54
00:03:55,700 --> 00:03:56,270
Google.
55
00:03:56,300 --> 00:04:03,800
Before then, most browsers used engines that were very basic, which meant that JavaScript was a little
56
00:04:03,800 --> 00:04:05,150
bit slow.
57
00:04:05,540 --> 00:04:07,130
You see, Google had this problem.
58
00:04:07,130 --> 00:04:08,900
They had something called Google Maps.
59
00:04:08,900 --> 00:04:13,700
And Google Maps, as you know, requires a lot of power.
60
00:04:13,820 --> 00:04:15,230
It does a lot of things.
61
00:04:15,230 --> 00:04:21,950
You can ask for directions to zoom in and zoom out, maybe even use Street View and all the previous
62
00:04:21,950 --> 00:04:26,440
engines before it would make Google Maps very, very slow on the browser.
63
00:04:26,450 --> 00:04:33,890
And Google, because they're a search engine, they want everybody to use their search engine and they
64
00:04:33,890 --> 00:04:37,270
built a browser in order for them to control more of the market.
65
00:04:37,280 --> 00:04:41,810
So with Google Maps and their own Chrome browser, they said, Hmm.
66
00:04:41,840 --> 00:04:45,080
We're going to write our own JavaScript engine, the V8 engine.
67
00:04:45,080 --> 00:04:50,990
So that JavaScript runs way faster on the browser than it's done previously.
68
00:04:51,640 --> 00:04:54,420
And in 2008 they released V eight.
69
00:04:54,430 --> 00:05:00,280
But the big takeaway for us here is that really, really smart people work on these engines so that
70
00:05:00,280 --> 00:05:08,230
our JavaScript runs as fast as possible on the browser, on the server or any type of computer.
71
00:05:08,230 --> 00:05:14,860
So every day JavaScript gets faster and faster for us because of the work that goes into these engines.
72
00:05:15,020 --> 00:05:15,450
Okay.
73
00:05:15,460 --> 00:05:20,980
But what is inside this engine, this magical machine that understands JavaScript?
74
00:05:21,670 --> 00:05:24,730
It reads our code and then it runs this code.
75
00:05:25,490 --> 00:05:27,710
Let's get into that in the upcoming video.
76
00:05:28,160 --> 00:05:28,460
Bye bye.
7396
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.