Pure Go Text/Code Editor Widget
GPU-accelerated, embeddable, zero CGO.
gogpu/editor is a reusable native text and code editor widget for Go — like Monaco Editor but for Go desktop and WASM applications. GPU-accelerated rendering via gogpu/gg, widget system via gogpu/ui.
- Embeddable — drop into any Go application as a widget
- GPU-accelerated — glyph atlas, ClearType LCD, MSDF fallback
- Pure Go — zero CGO, cross-compiles everywhere (Windows, macOS, Linux, WASM)
- Code editor — syntax highlighting, line numbers, code folding
- Rich text — multi-font, styled runs, WYSIWYG editing
- IDE-ready — LSP client, DAP client, minimap, diagnostics
🚧 Early development. Architecture defined in ADR-028 (internal).
gogpu/editor/
├── document/ # PieceTable document model, undo/redo
├── layout/ # Text layout engine, line breaking, styled runs
├── view/ # Editor widget, gutter, cursor, selection, minimap
├── input/ # Keyboard, mouse, IME
├── syntax/ # Syntax highlighting (TextMate, Tree-sitter)
└── lsp/ # Language Server Protocol client (future)
| Editor | Key Pattern | What We Take |
|---|---|---|
| VS Code | PieceTree document model | Efficient insert/delete data structure |
| Monaco | MVVM, decorations | Separation of model, view, decorations |
| Scintilla | Simple Model-View | 25 years proven, portable |
| Zed | GPU-accelerated, GPUI | GPU text rendering patterns |
| CodeMirror 6 | Immutable state, plugins | Functional state management |
| Xi-editor | Rope, async frontend-backend | Data structure research |
| cosmic-text | Pure Rust text layout | Pure language text layout patterns |
Part of the gogpu Pure Go GPU ecosystem:
| Repo | Purpose |
|---|---|
| gogpu | App framework, windowing |
| wgpu | Pure Go WebGPU |
| gg | 2D graphics, GPU text rendering |
| ui | GUI toolkit |
| editor | Text/Code editor widget ← you are here |
Contributions welcome! Architecture decisions and open questions are tracked internally. Join the discussion to participate.
MIT
