Why Ghostty Terminal is Written in Zig (and Not Rust or Go)
Ghostty Terminal, a lighting fast and feature rich terminal emulator, has gotten lots of attention in very short period of time. Not only for what it brings on the table but also because it’s written in the Zig programming language.
Mitchell Hashimoto (co-founder of HashiCorp) made this choice and people have been wondering why he did not build it using Rust or GoLang which are proven and popular now a days. Let’s try to find reasons of choosing Zig for Ghostty, this will also help us to understand what makes Zig unique and will it be the future for system programming..
What makes Ghostty Unique?
Ghostty uses native UIs which makes provides a consistent and familiar experience for users. Their are various other options available, you might find super fast ones but they lack features.
Then comes Ghostty that provides features, performance and Native UI all packed in one terminal.
It is fast like Alacritty in rendering performance. Deeply integrated into platform-specific environments for best user experience while being lightweight and lot of options to customize.
In order too achieve its needs a language that balances low-level control, performance and developer flexibility, ZIG was required.
Zig: Why it's Used for Ghostty Terminal
Zig is a new language that bridges the gap between low-level programming (like C) and modern safety features (like Rust). Here’s why Zig was chosen:
Performance and Control
Zig compiles directly to machine code, same as C. Ghostty benefits from this especially for GPU accelerated rendering. On macOS it uses Metal, on Linux it uses OpenGL.
Zig’s low-level nature means no overhead, so Ghostty can push the limits of the hardware. Ghostty uses SIMD instructions and fine tunes code for architectures like ARM on Apple Silicon for platform specific optimizations.
Simplicity Over Complexity
Rust has great safety guarantees but introduces a lot of complexity with its borrow checker and lifetimes. While these features reduce bugs, they slow down development. Go sacrifices low-level control for simplicity. Zig is in the middle:
It allows manual memory management with safety tools which means developers have control like C but Zig avoids null pointers and undefined behavior with built-in safety nets.
Zig avoids implicit heap allocations so performance is predictable. What is you code is what you get their are no hidden behaviors.
A Language for Developers
Zig’s design philosophy is developer centric. To achieve seamless C integration Ghostty uses GTK4 (Linux) and SwiftUI (macOS) for native interfaces.
Unlike Rust’s Result type or Go’s error checks, Zig’s try syntax doesn’t pollute the code and makes error handling simple.
Mitchell Hashimoto himself said Zig is “fun to work with”. Unlike Rust which he described as not always fun due to its steep learning curve and strict compiler rules, Zig is simple and fun again.
The Zig programming language is gaining mainstream adoption and already many other companies that utilizing Zig to improve their products including big giants like Uber.
Why Not Rust or Go?
By choosing Zig, Mitchell Hashimoto got low level control, safety and developer joy. Zig is indeed best of Ghostty’s needs:
Rust
Rust provides great safety through ownership and borrow checking but it doesn’t align with Ghostty’s needs. Here is why:
- Slower prototyping: Writing idiomatic Rust takes time, especially for projects that need rapid iterations.
- High Complexity: Rust’s learning curve and lifetimes are too much for developers who value simplicity.
- Overkill for Ghostty: Safety was important but not at the cost of development speed. Zig’s error handling was enough for the project’s needs.
Go
Go is easy to use and fast to develop. But their are two main reasons why it was not suitable for Ghostty:
- Garbage collection: Go’s garbage collection introduces unpredictable latencies which is bad for a terminal emulator where responsiveness is key.
- Lack of low level control: Ghostty’s GPU rendering and platform native integrations require more control over memory and hardware which Go can’t provide.
Zig’s Role in Ghostty’s Architecture
Zig is all over Ghostty from its rendering pipeline, making it smooth as butter even with large text files or complex fonts to native integration. On Linux, Ghostty uses Zig to talk to GTK4/libadwaita which makes the terminal feels like a native part of the OS. While on macOS, SwiftUI is integrated using Zig’s C bindings.
Ghostty’s core is the libghostty library, a C-ABI compatible library written in Zig. This allows other developers to build on top of Ghostty for extending Ghostty's capabilities without having to reinvent the wheel.
Community and Long Term
Ghostty also benefits the Zig community. Ghostty has found areas to improve in the Zig compiler, helping it to mature. As a big project, Ghostty is a showcase for Zig, so other developers will want to try the language increasing it's overall adoption.
Conclusion
Ghostty Terminal is proof that Zig can be used for performance critical applications. Rust and Go are great, but Zig was the right tool for Ghostty’s vision of speed, simplicity and native integration.
If you want a terminal that redefines responsiveness and customization and supports modular architecture, Ghostty is the future and has the potential to become the most used terminal of 2025.