Skip to main content
Go Time

Writing a shell in Go

65 min episode · 2 min read
·

Episode

65 min

Read time

2 min

AI-Generated Summary

Key Takeaways

  • Language Selection: Go provided modern syntax, complete system call bindings, and garbage collection in 2013 when alternatives were C/C++, Java, or Python - eliminating need for custom memory management.
  • Standard Library Leverage: Half of Elvish's modules directly wrap Go's standard library using reflection - strings, regex, HTTP, math, and OS packages become shell commands with minimal code.
  • Cross-Platform Strategy: Go's os/exec package handles program launching portably across Unix and Windows, requiring platform-specific code only for keyboard input parsing and system-dependent metadata fields.
  • Programming Language Features: Elvish implements nested lists, maps, lambdas, and functional programming paradigms that traditional shells lack - anything representable in JSON works in Elvish scripting.
  • Built-in UI Components: Control-N launches file manager with three-pane view, Control-R shows filterable command history list instead of single-match search - enhancing interactive shell experience significantly.

What It Covers

Chi Shao explains building Elvish shell in Go over eleven years, covering language design decisions, cross-platform compatibility, built-in programming features, and Go's advantages for systems programming.

Key Questions Answered

  • Language Selection: Go provided modern syntax, complete system call bindings, and garbage collection in 2013 when alternatives were C/C++, Java, or Python - eliminating need for custom memory management.
  • Standard Library Leverage: Half of Elvish's modules directly wrap Go's standard library using reflection - strings, regex, HTTP, math, and OS packages become shell commands with minimal code.
  • Cross-Platform Strategy: Go's os/exec package handles program launching portably across Unix and Windows, requiring platform-specific code only for keyboard input parsing and system-dependent metadata fields.
  • Programming Language Features: Elvish implements nested lists, maps, lambdas, and functional programming paradigms that traditional shells lack - anything representable in JSON works in Elvish scripting.
  • Built-in UI Components: Control-N launches file manager with three-pane view, Control-R shows filterable command history list instead of single-match search - enhancing interactive shell experience significantly.

Notable Moment

Shao reveals Elvish values are actually Go values under the hood, meaning Go's garbage collector automatically handles memory management for the shell language without requiring a custom implementation.

Know someone who'd find this useful?

You just read a 3-minute summary of a 62-minute episode.

Get Go Time summarized like this every Monday — plus up to 2 more podcasts, free.

Pick Your Podcasts — Free

Keep Reading

More from Go Time

We summarize every new episode. Want them in your inbox?

Similar Episodes

Related episodes from other podcasts

This podcast is featured in Best Cybersecurity Podcasts (2026) — ranked and reviewed with AI summaries.

You're clearly into Go Time.

Every Monday, we deliver AI summaries of the latest episodes from Go Time and 192+ other podcasts. Free for up to 3 shows.

Start My Monday Digest

No credit card · Unsubscribe anytime