Skip to content

refactor(libghostty): restructure and harden native and Wasm C ABI bindings - #146

Merged
elias8 merged 3 commits into
mainfrom
refactor/libghostty-abi
Aug 17, 2026
Merged

refactor(libghostty): restructure and harden native and Wasm C ABI bindings#146
elias8 merged 3 commits into
mainfrom
refactor/libghostty-abi

Conversation

@elias8

@elias8 elias8 commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Redesign libghostty’s C ABI seam around focused native and Wasm bindings while preserving existing behavior and keeping platform details internal. Strengthen runtime layout, result, ownership, lifetime, callback, and memory safety; improve hot path allocation behavior; expose idiomatic public wrappers; and align ABI and behavioral tests with the shared native and Wasm contracts.

This change touches nearly every file in the libghostty package and is close to a complete internal rewrite, while preserving existing behavior and most of the public API. The public API was already in a good place, but the internals had not kept pace with the growth of the C ABI since the package’s initial implementation. I have wanted to do this refactoring for some time. The resulting structure gives each platform binding a clearer boundary, makes behavioral consistency between native and Wasm explicit and enforceable, and should make future ABI additions easier to implement and maintain.

I plan a few focused follow up PRs, mainly around the build system and further quality improvements.

Note: I planned and iterated on these changes myself, while using LLMs extensively for the mechanical implementation work.

@elias8
elias8 force-pushed the refactor/libghostty-abi branch 4 times, most recently from d7da3b3 to 3bb1779 Compare August 16, 2026 22:25
@elias8
elias8 force-pushed the refactor/libghostty-abi branch from 3bb1779 to 663e851 Compare August 17, 2026 10:40
@elias8
elias8 force-pushed the refactor/libghostty-abi branch from 663e851 to 451f4b0 Compare August 17, 2026 11:06
@elias8 elias8 added pkg:libghostty Core Dart bindings package pkg:flterm Flutter terminal widget package ci CI workflows and GitHub Actions refactor Code restructuring without behavior change breaking Contains breaking API changes labels Aug 17, 2026
@elias8
elias8 marked this pull request as ready for review August 17, 2026 11:19
@elias8
elias8 merged commit e6b7230 into main Aug 17, 2026
21 checks passed
@elias8
elias8 deleted the refactor/libghostty-abi branch August 17, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Contains breaking API changes ci CI workflows and GitHub Actions pkg:flterm Flutter terminal widget package pkg:libghostty Core Dart bindings package refactor Code restructuring without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant