Why Go for TypeScript Developers
You already think in types — Go rewards that
Section titled “You already think in types — Go rewards that”If you write TypeScript today, you already understand the value of static types, compiler errors, and deliberate interfaces. Go takes those instincts and pushes them even further: there is no runtime type-stripping, no separate compile step that you “skip” in development, and no node_modules folder with thousands of transitive dependencies.
This course assumes you are comfortable with TypeScript and Node.js. Every concept is introduced by comparison — what you already know, and how Go does the same thing (or why it does it differently).
Why Go?
Section titled “Why Go?”Compiled to a single binary
Section titled “Compiled to a single binary”TypeScript compiles to JavaScript, which still needs a Node.js runtime to execute. Go compiles directly to a native machine-code binary. You ship one file. No runtime required on the target machine.
// ship: node dist/index.js// needs: Node.js runtime installed// size: node_modules/ can be 200+ MB// ship: ./myapp (single binary, ~5 MB)// needs: nothing on the server// $ go build -o myapp .Statically typed — no runtime surprises
Section titled “Statically typed — no runtime surprises”TypeScript’s types exist at development time only; they are erased before your code runs. Go’s types are enforced by the compiler and present at runtime. A program that compiles in Go is type-safe all the way through execution.
Blazing-fast startup and throughput
Section titled “Blazing-fast startup and throughput”Node.js (V8) is fast, but it has JIT warm-up time and a garbage collector tuned for long-running servers. Go starts in milliseconds, handles hundreds of thousands of concurrent connections via goroutines, and its GC has sub-millisecond pauses. For CLIs, microservices, and system tools, Go’s performance profile is hard to beat.
First-class concurrency with goroutines
Section titled “First-class concurrency with goroutines”Node.js is single-threaded and uses an event loop for async I/O. Go uses goroutines — lightweight threads that the Go runtime multiplexes across real OS threads. You write sequential-looking code and the runtime handles parallelism. We preview this in the mental model lesson; it is covered in depth later.
// TypeScript: async/await + event loopasync function fetchAll(urls: string[]) { const results = await Promise.all( urls.map(url => fetch(url).then(r => r.json())) ); return results;}// Go: goroutines + channelsfunc fetchAll(urls []string) []any { results := make([]any, len(urls)) var wg sync.WaitGroup for i, url := range urls { wg.Add(1) go func(i int, url string) { defer wg.Done() // fetch logic here _ = i; _ = url }(i, url) } wg.Wait() return results}Explicit errors, not exceptions
Section titled “Explicit errors, not exceptions”TypeScript throws exceptions. You wrap code in try/catch and hope nothing slips through. Go returns errors as plain values. Every function that can fail says so in its return type, and you handle the error immediately at the call site — there is nothing to “forget”.
// TypeScript: exceptions can bubble silentlytry { const data = JSON.parse(input); processData(data);} catch (err) { console.error("something went wrong", err);}// Go: errors are return values, handled explicitlydata, err := parseInput(input)if err != nil { return fmt.Errorf("failed to parse input: %w", err)}processData(data)What this course covers
Section titled “What this course covers”This course takes you from zero Go knowledge to writing idiomatic, production-ready Go — using your TypeScript experience as a bridge. Here is what we cover:
| Module | Topics |
|---|---|
| Intro (this module) | Why Go, mindset shifts, setup, hello world, project layout |
| Go 101 | Variables, functions, control flow, errors, structs, interfaces, collections, packages |
| (coming soon) | Goroutines, channels, HTTP servers, databases, testing |
What to expect
Section titled “What to expect”- Every concept is shown as a TypeScript vs Go side-by-side comparison.
- Runnable playgrounds let you experiment directly in the browser.
- Quizzes reinforce the key ideas.
- Go-only concepts (no TypeScript equivalent) are clearly called out.
You do not need to install anything to follow along — the playground runs Go in the browser. When you are ready to set up a local environment, the next lesson walks you through it.
package main
import "fmt"
func main() { // Welcome to Go! This is your first program. // Click Run to execute it. message := "Hello from Go!" fmt.Println(message)
// Go infers the type — just like TypeScript's let year := 2024 fmt.Printf("Year: %d\n", year)}Loading Go runtime (first run only, ~8 MB)…