# Writing a shell in Go Page: https://stenobird.com/podcast/go-time-golang-software-engineering/writing-a-shell-in-go Text version: https://stenobird.com/podcast/go-time-golang-software-engineering/writing-a-shell-in-go.md Podcast: [Go Time: Golang, Software Engineering](https://stenobird.com/podcast/go-time-golang-software-engineering) Published: 2024-11-06T21:00:00+00:00 Episode link: https://changelog.com/gotime/336 Audio file: https://op3.dev/e/https://cdn.changelog.com/uploads/gotime/336/go-time-336.mp3 Processing state: processed JSON: https://stenobird.com/v1/public/podcasts/go-time-golang-software-engineering/episodes/writing-a-shell-in-go Duration seconds: 3922 ## Resource An exploration of the technical design and implementation of Elvish, a programmable shell written in Go. The discussion covers the trade-offs between traditional shell commands and a language-centric approach to command execution. ## Highlights - Main idea: Elvish treats the shell more like a programming language than a simple command executor, using namespaces to separate built-ins from system utilities - Practical takeaway: Using programmable loops and built-in functions can improve the portability of scripts across different operating systems - Failure mode: Relying on LLMs for destructive file operations carries high risk, even if the code is syntactically correct - Technical insight: High test coverage is a critical safety net when using AI-generated code to ensure existing behaviors remain intact - Design philosophy: Moving away from complex flags (like mkdir -p) toward native language constructs like for-loops simplifies the shell's core logic ## Topics Go programming, Shell development, Elvish shell, Systems programming, Software architecture, Linux kernel, Automation, Programming language design ## Chapters - 1:00 — The Reality of Cloud Abstractions: A discussion on why understanding the underlying Linux kernel features and VM management is more useful than treating the cloud as a black box. - 6:10 — Developing Elvish: The journey of moving from Zsh and Fish to developing a custom shell and eventually using it as a daily driver. - 11:05 — The Shell as a Runtime: Comparing the shell environment to a browser, where functionality is delegated to various integrated applications and tools. - 21:00 — Go for Systems Programming: Reflecting on Go's evolution from a systems language to its current niche in modern infrastructure and tooling. - 30:50 — Built-in File Management: Exploring Elvish's integrated file manager and UI features inspired by tools like Ranger. - 40:10 — Functional Programming in Go: The challenges of implementing function bindings and handling the differences between Go's standard library and Elvish's runtime. - 54:55 — Testing and LLMs: The intersection of high code coverage and the use of Large Language Models for generating tests and refactoring code. ## Actions - request_transcript: `POST https://stenobird.com/v1/public/podcasts/go-time-golang-software-engineering/episodes/writing-a-shell-in-go/transcription-requests` — Idempotently request low-priority transcript generation for this episode. - read_markdown: `GET https://stenobird.com/podcast/go-time-golang-software-engineering/writing-a-shell-in-go.md` — Read the agent-friendly Markdown representation of this episode resource. A page view does not enqueue transcription. Agents should invoke `request_transcript` explicitly when they need this episode processed. ## Transcript Full transcripts are not published on public pages unless there is a clear rights basis.