I built Go bindings for libghostty using cgo, pairing it with Zig as the C compiler for cross-compilation. This adds Go to the language integration work alongside expanding c api capabilities and draws on Zig’s cross-compilation strengths described in zig systems applications.
I wrote Go for the first time in 3 years.
I built some libghostty bindings for Go.
The Go bindings use cgo.
I said libghostty can be fully static.
I said libghostty only depends on libc.
I said mixing cgo + Zig as the C compiler lets you cross compile easily.
I shared https://t.co/bf3E2GIl3y about the Go bindings.
I also shared https://t.co/EX9sFoeDEP about the Go bindings.
I posted about this Go and libghostty work on 2026-04-10 18:21 UTC.
I’m expanding libghostty’s reach through web support, Rust bindings, WebAssembly-friendly metadata, and prebuilt platform packages. These efforts make the library easier to integrate across languages and platforms, while shaping the ABI and compatibility commitments I need to consider alongside abi stability and compatibility.
I pointed @olvrgln to libghostty-web and said the intention is to ultimately provide that all first class.
I said some Ghostty maintainers made a really high quality Rust crate in front of libghostty-vt.
The repository includes a full port of Ghostling, which I described as a full terminal in a single Rust file!
I praised the Rust crate’s API as beautiful.
I said libghostty-vt now has an API to dump its exported structs as JSON with size/alignment/type info to help bindings.
I said the data is generated at compile-time and stored in read-only memory.
I said you're not paying any runtime cost to generate this.
I said libghostty itself doesn’t need to embed any kind of machinery to encode JSON.
I said the example/wasm-vt example in the Ghostty project shows how its used.
I said we call this after loading libghostty, decode and cache the data, and then use it with some helpers to set struct fields by byte offset.
I said this approach is necessary because WebAssembly doesn’t have a formal struct system.
I said we don't want to expose a bunch of functions we have to promise ABI compatibility for.
I announced that we now build binary “xcframework” packages for libghostty.
I said we build the packages on every commit.
The packages are built for macOS and iOS.
I said the packages are available via GitHub releases and blob storage.
I said users can drop them into Xcode or in a Package.swift.
I said: No Zig headaches. No build step.
Related: expanding c api capabilities, api docs and integration, terminal apis and capabilities