|
| 1 | +--- |
| 2 | +title: "Introduction" |
| 3 | +format: |
| 4 | + revealjs: |
| 5 | + theme: [default, reveal.scss] |
| 6 | +editor: visual |
| 7 | +preload-iframes: true |
| 8 | +--- |
| 9 | + |
| 10 | +## Welcome |
| 11 | + |
| 12 | +## Objectives |
| 13 | + |
| 14 | +# {background-image="https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/1cc5e3ff-37e5-4b9c-abf4-92304fafa4c9/deekqx1-20d6363f-185e-4f8d-a748-f5b3f3b8fdde.gif?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7InBhdGgiOiJcL2ZcLzFjYzVlM2ZmLTM3ZTUtNGI5Yy1hYmY0LTkyMzA0ZmFmYTRjOVwvZGVla3F4MS0yMGQ2MzYzZi0xODVlLTRmOGQtYTc0OC1mNWIzZjNiOGZkZGUuZ2lmIn1dXSwiYXVkIjpbInVybjpzZXJ2aWNlOmZpbGUuZG93bmxvYWQiXX0.bQwR0OGahVNiMtiHhvn95SFiuAZKxapsWSr_AbMK_Oc"} |
| 15 | + |
| 16 | +::: {style="background-color: #ffffffbb; border-radius: 10px; padding: 5px;"} |
| 17 | +::: r-fit-text |
| 18 | +Computation |
| 19 | +::: |
| 20 | +::: |
| 21 | + |
| 22 | +::: fragment |
| 23 | +[{fig-alt="transistor icon" fig-align="center"}](https://www.flaticon.com/free-icons/transistor) |
| 24 | +::: |
| 25 | + |
| 26 | +```{r} |
| 27 | +intToBits(10L) |
| 28 | +``` |
| 29 | + |
| 30 | +::: notes |
| 31 | +Computers represent info using binary code in the form of digital 1s and 0s inside the central processing unit ([CPU](https://www.techtarget.com/whatis/definition/processor)) and RAM. These digital numbers are electrical signals that are either on or off inside the CPU or [RAM](https://www.techtarget.com/searchstorage/definition/RAM-random-access-memory). |
| 32 | + |
| 33 | +Each transistor is a switch, that is, **0** when turned off and **1** when turned on. The more transistors, the more switches. |
| 34 | + |
| 35 | +Transistors are the basic building blocks that regulate the operation of computers, mobile phones, and all other modern electronic circuits and is the basic unit of the CPU |
| 36 | +::: |
| 37 | + |
| 38 | +## Computer Hardware |
| 39 | + |
| 40 | +::: columns |
| 41 | +::: {.column width="33%"} |
| 42 | +#### CPU (Processing) |
| 43 | + |
| 44 | +{fig-align="center"} |
| 45 | +::: |
| 46 | + |
| 47 | +::: {.column width="33%"} |
| 48 | +#### RAM (memory) |
| 49 | + |
| 50 | +{fig-align="center"} |
| 51 | +::: |
| 52 | + |
| 53 | +::: {.column width="33%"} |
| 54 | +#### I/O |
| 55 | + |
| 56 | +{fig-align="center" width="300"} {fig-align="center" width="300"} |
| 57 | +::: |
| 58 | +::: |
| 59 | + |
| 60 | +::: notes |
| 61 | +### CPU |
| 62 | + |
| 63 | +- The central processing unit (CPU), or the processor, is the brains of a computer. The CPU is responsible for performing numerical calculations. |
| 64 | + |
| 65 | +<!-- --> |
| 66 | + |
| 67 | +- The faster the processor, the faster R will run. |
| 68 | + |
| 69 | +- The clock speed (or clock rate, measured in hertz) is the frequency with which the CPU executes instructions. The faster the clock speed, the more instructions a CPU can execute in a section. |
| 70 | + |
| 71 | +RAM |
| 72 | + |
| 73 | +- Random access memory (RAM) is a type of computer memory that can be accessed randomly: any byte of memory can be accessed without touching the preceding bytes. |
| 74 | + |
| 75 | +- The amount of RAM R has access to is incredibly important. Since R loads objects into RAM, the amount of RAM you have available can limit the size of data set you can analyse. MEMORY BOUND |
| 76 | + |
| 77 | +<!-- --> |
| 78 | + |
| 79 | + Even if the original data set is relatively small, your analysis can generate large objects |
| 80 | +::: |
| 81 | + |
| 82 | +## Moore's law |
| 83 | + |
| 84 | +<iframe src="https://ourworldindata.org/grapher/transistors-per-microprocessor" loading="lazy" style="width: 100%; height: 600px; border: 0px none;"> |
| 85 | +
|
| 86 | +</iframe> |
| 87 | + |
| 88 | +::: notes |
| 89 | +When the price is unchanged, the number of components that can be accommodated on the integrated circuit will **double every 18-24 months**, and the performance will double. In other words, the performance of a computer that can be bought for every dollar will more than double every 18-24 months |
| 90 | +::: |
| 91 | + |
| 92 | +## Yet... |
| 93 | + |
| 94 | +### we've hit clock speed stagnation |
| 95 | + |
| 96 | +[{fig-align="center"}](https://github.com/karlrupp/microprocessor-trend-data) |
| 97 | + |
| 98 | +## |
| 99 | + |
| 100 | +# About R |
| 101 | + |
| 102 | +## R is an interpreted language |
| 103 | + |
| 104 | +::: columns |
| 105 | +::: {.column width="50%"} |
| 106 | +**Compiled language** |
| 107 | + |
| 108 | +Converted directly into machine code that the processor can execute. |
| 109 | + |
| 110 | +- Tend to be faster and more efficient to execute. |
| 111 | + |
| 112 | +- Need a "build" step which builds for system they are run on |
| 113 | + |
| 114 | +- **Examples:** C, C++, Erlang, Haskell, Rust, and Go |
| 115 | +::: |
| 116 | + |
| 117 | +::: {.column width="50%"} |
| 118 | +#### **Interpreted Languages** |
| 119 | + |
| 120 | +Code interpreted line by line during run time. |
| 121 | + |
| 122 | +- significantly slower although [just-in-time compilation](https://guide.freecodecamp.org/computer-science/just-in-time-compilation) is closing that gap. |
| 123 | + |
| 124 | +- much more expressive and flexible |
| 125 | + |
| 126 | +- \*\*Examples: R\*\*, Ruby, Python, and JavaScript. |
| 127 | +::: |
| 128 | +::: |
0 commit comments