Go From Scratch/The Language

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Go is...

- Compiled rather than interpreted. This means your program is converted into direct machine code at the start when it is compiled before running. This makes the program much more efficient right from the start, but the program itself cannot be modified while running (though it is possible to get around this with certain libraries).

- Concurrent rather than strictly sequential. This means you can set up multiple threads within your program to work in parallel. This allows the ability to use multiple CPU cores, and simplifies the structures needed to perform some complex tasks.

- Memory-safe. This means Go handles your usage of memory to prevent going out of bounds and crashing your program (or worse).

- Garbage-collected. This means memory data that will no longer be used is freed up for reuse, and your still-used data can be stored more efficiently.