Why Ghostty is written in Zig (not Rust or Go)

Changelog Changelog Jan 11, 2025

Audio Brief

Show transcript
This episode explores a developer's choice of Zig for a new terminal project, balancing technical requirements with personal enjoyment. Key takeaways include: prioritizing developer joy, defining non-negotiable requirements, and acknowledging personal preference. Developer joy is paramount. Choosing a technology one genuinely enjoys significantly contributes to long-term project success, even over purely technical impressiveness like Rust. Define non-negotiable requirements early. Constraints like avoiding a garbage collector immediately narrow language options, streamlining selection. Personal preference is a valid criterion. The best tool aligns with individual style, boosting productivity and satisfaction more than popular opinion. This approach highlights the nuanced factors in modern systems programming language decisions.

Episode Overview

  • The speaker, a prolific open-source developer, explains his decision to use the Zig programming language for his new terminal project.
  • He discusses his background in C and his desire for a "better C" for low-level systems programming.
  • The choice of Zig is compared to other popular options like Go and Rust, detailing why they were not selected.
  • A key theme is the importance of developer joy and personal preference in choosing a programming language, beyond purely objective technical merits.

Key Concepts

  • Zig Programming Language: The discussion centers on the choice of Zig, a modern systems programming language that offers low-level control similar to C.
  • Systems Programming: The speaker's primary interest is in systems-level development, requiring direct memory management and control, without a garbage collector or runtime.
  • Language Selection Philosophy: The choice was driven by a combination of technical requirements (no garbage collection), a desire for a C-like experience with modern improvements, and the subjective element of developer enjoyment.
  • Comparison to Go and Rust: Go was ruled out due to its active runtime and garbage collector. Rust, while technically impressive, was not chosen because the speaker finds it less enjoyable to write and read on a daily basis.

Quotes

  • At 00:20 - "And then chooses Zig as a programming language. Like these are all things where it's like, I know why there's 25,000 people in that Discord." - Highlighting the combination of factors that makes the speaker's choice of Zig so compelling to the developer community.
  • At 01:24 - "I wanted to get back to systems programming, but I recognized the warts that C had, and I was looking for a better C. And Zig to me always felt like that." - Explaining the core motivation for seeking a new language and why Zig fit his mental model.
  • At 03:00 - "When I write and read Rust, I'm not having fun, and I want to have fun... and part of the joy is writing the code." - Emphasizing that the subjective experience and personal enjoyment of using a language was a primary factor in his decision over the technically respected alternative, Rust.

Takeaways

  • Prioritize developer joy in your tool selection. For long-term projects, choosing a technology that you genuinely enjoy using can be as important for success as its technical capabilities.
  • Define your non-negotiable requirements first. The speaker knew he didn't want a garbage collector, which immediately narrowed the field of potential languages and simplified the decision-making process.
  • Acknowledge that personal preference is a valid decision-making criterion. While technical benchmarks are important, the best tool is often the one that fits your personal style and makes you most productive and happy, which may differ from popular opinion.