Files
bootdotdev-fcc-learn-golang…/course/1-intro/exercises/6-what_is_compiled/readme.md
wagslane 9be3074de6 first
2023-05-01 15:25:27 -06:00

1.1 KiB

Compiling explained

Computers don't know how to do anything unless we as programmers tell them what to do.

Unfortunately computers don't understand human language. In fact, they don't even understand uncompiled computer programs.

For example, the code:

package main

import "fmt"

func main(){
  fmt.Println("hello world")
}

means nothing to a computer.

Computers need machine code

A computer's CPU only understands its own instruction set, which we call "machine code".

Instructions are basic math operations like addition, subtraction, multiplication, and the ability to save data temporarily.

For example, an ARM processor uses the ADD instruction when supplied with the number 0100 in binary.

Go, C, Rust, etc.

Go, C, and Rust are all languages where the code is first converted to machine code by the compiler before it's executed.

compiler