Fireship · @fireship

JavaScript: How It's Made

Uploaded July 2, 2019 · Length 10:54

JavaScript: How It's Made

Summary

This video explains the computer science behind JavaScript, covering its high-level, single-threaded, garbage-collected, and interpreted nature, as well as its dynamic typing, multi-paradigm, and prototype-based design.

  • javascript
  • computer science
  • programming language
  • high-level language
  • single-threaded
  • garbage collection
  • interpreted language
  • dynamic typing
  • multi-paradigm
  • prototype-based

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    today on how they do it JavaScript today

  2. 0:02

    we'll look at the computer science

  3. 0:04

    behind it so by the end of this video

  4. 0:05

    you should understand what a high-level

  5. 0:07

    single-threaded garbage-collected

  6. 0:08

    interpreted or just-in-time compiled

  7. 0:10

    prototype-based multi-paradigm dynamic

  8. 0:12

    language with a non-blocking event loop

  9. 0:13

    concurrency model really means if you're

  10. 0:22

    new you're like and subscribe because

  11. 0:23

    this is part 2 of the full javascript

  12. 0:25

    course on fire ship i/o last week we

  13. 0:27

    learn that javascript is a programming

  14. 0:28

    language based on the ECMO 262 spec but

  15. 0:31

    in order to really understand how it

  16. 0:32

    works in a computer system we need to go

  17. 0:34

    to the very bottom of the stack and by

  18. 0:35

    that I mean the bare metal CPU and

  19. 0:37

    memory on a machine this is a riddle

  20. 0:38

    computer on hearing Ishida the tips that

  21. 0:41

    make the computer work when you run a

  22. 0:44

    JavaScript program whether that be a web

  23. 0:45

    application in the browser or something

  24. 0:47

    server side with nodejs it needs to

  25. 0:49

    allocate memory on your RAM to store

  26. 0:51

    things for the runtime and for variables

  27. 0:53

    and objects that you reference in your

  28. 0:54

    code then it also needs a thread from

  29. 0:57

    your CPU to actually execute the

  30. 0:59

    instructions in your code but here's the

  31. 1:01

    thing as a JavaScript developer you

  32. 1:03

    never really have to think about this

  33. 1:04

    stuff because it's a high-level

  34. 1:05

    programming language but what do we

  35. 1:07

    really mean when we say high-level we're

  36. 1:09

    talking about the degree of abstraction

  37. 1:10

    or simplification that the language

  38. 1:12

    provides over the computer's hardware

  39. 1:14

    the lowest level language is machine

  40. 1:16

    code

  41. 1:16

    it's a numeric language that can be

  42. 1:18

    executed directly by the CPU but it

  43. 1:20

    would be extremely difficult to build a

  44. 1:21

    website with it because you would have

  45. 1:22

    to memorize a number for every single

  46. 1:24

    instruction that you want to run if we

  47. 1:26

    go up one level to assembly we get some

  48. 1:28

    syntactic sugar but each assembly

  49. 1:29

    language is specific to a particular CPU

  50. 1:31

    or operating system so we can move up

  51. 1:33

    another level to the C language which

  52. 1:36

    provides a modern syntax and the ability

  53. 1:37

    to write cross-platform programs but the

  54. 1:40

    developers still has to be concerned

  55. 1:41

    with low-level issues like memory

  56. 1:42

    allocation if we go one more step higher

  57. 1:45

    we reach the level of languages like

  58. 1:46

    JavaScript and Python that use

  59. 1:48

    abstractions like garbage collectors and

  60. 1:50

    dynamic typing to simplify the way

  61. 1:51

    developers write their applications so

  62. 1:54

    now that we're at this high level let's

  63. 1:55

    go ahead and unpack a few of the key

  64. 1:57

    terms related to JavaScript now there

  65. 1:59

    are two fundamental ways that we can