## Code abstraction cake
Code is [[Coding and writing are converging|converging with writing]] and speech, and this diagram shows the different layers of abstraction in programming languages.
![[assets/code-cake.png]]
We start with a layer of mathematics and physics and work our way up to interpreted languages. Code at each layer exists today, so it's less a chronological progression than just different ways to do the same thing. And each new layer gets more and more abstract: that is, closer and closer to human speech.
## The first computer program
The first computer program was created by a woman named [[Ada Lovelace]], who, when she saw [[Charles Babbage]]'s "Analytical Engine", which Babbage had created for the purposes of calculation. Lovelace saw potential in the engine that was beyond calculation, and she created the first ever computer program:
![[assets/first_computer_program.png]][^first]
## Binary code
![[assets/binary-alphabet.png]] [^binary]
Binary code consists of 0s and 1s, and is used to encode data into a simple on/off or yes/no pattern. Each 0 or 1 is a binary digit, or bit. We need to string together 8 of them to form unique representations of characters, and we call 8 of them a byte.
## Machine code
![[assets/machine-code.jpeg]] [^machinecode]
Machine code interprets binary code in hexadecimal form. It's used to send instructions directly to a computer's CPU.
## Assembly code
![[assets/assembly-code.png]] [^assembly]
This is assembly code, specifically for a Motorola 68000 microprocessor. Assembly code makes machine code more functional, adding special keywords. This is a huge jump in abstraction as programmers at this level can now use words instead of pure numbers.
## Compiled languages
Compiled languages are also known as high-level languages, referring to their [[Respect Levels of Abstraction|level of abstraction]]. At this point the code is starting to become more intelligible, more human readable. There is still a structure there, but there is a distinct shift away from numbers and towards readable (English) words.
- [[Fortan]]
- [[Go]]
- [[C]]
- [[C#|Csharp]]
- [[C++]]
- [[Java]] is partially compiled and partially interpreted.
## Interpreted languages
Interpreted languages are like compiled languages in that they are translated to machine code, but the difference is that interpreted languages are translated at runtime.
- [[JavaScript]]
- [[Python]]
- [[Ruby]]
- [[Perl]]
- most modern programming languages.
## Related
- [Convergence of Code and Speech presentation](https://slides.nicolevanderhoeven.com/2021-convergence-of-code-and-speech/#/)
## References
[^first]: _Ada Lovelace: Great minds_. (2013). Retrieved in June 2021 from [SciShow on YouTube](https://www.youtube.com/watch?v=uBbVbqRvqTM).
[^machinecode]: BigDumbDinosaur, representing BCS Technology Limited. (2012). _Machine code monitor_. Retrieved in June 2021 from [Wikipedia](https://en.wikipedia.org/wiki/Machine_code).
[^assembly]: Holley, M. (1980). _Motorola 6800 assembly language_. Retrieved in June 2021 from [Wikipeda](https://en.wikipedia.org/wiki/Assembly_language)
[^binary]: Zych, A. (2015). _Write your name in binary code_. Retrieved in June 2021 from [Science Friday](https://www.sciencefriday.com/educational-resources/write-your-name-in-binary-code/).