The native alternative to Electron and Tauri
This Go code is this app.
Desktop apps without a browser inside: GPU-rendered, written in plain Go, shipped as one small binary for Linux, macOS, Windows and the web. This is the real source, running here as WebAssembly.
// Package signal is Signal studio: a live waveform you shape with sliders,// in any of ImmyGo's ten themes. It is a package so that other programs// (the immygo.app demo bundle) can run it; main.go runs it.package signal
import ( "fmt" "math" "time"
"github.com/amken3d/immygo/theme" "github.com/amken3d/immygo/ui")
// Main runs Signal studio in a window. It blocks until the window closes.func Main() { build, themeRef := New() ui.Run("Signal studio", build, ui.Size(960, 600), ui.WithThemeRef(themeRef))}
// New builds the app. While the signal runs, each frame asks for the// next; paused, the app draws nothing until you touch it.func New() (build func() ui.View, themeRef *ui.ThemeRefValue) { themeRef = ui.NewThemeRef(themes[0].new()) names := make([]string, len(themes)) for i, t := range themes { names[i] = t.name } picker := ui.Dropdown(names...).SetSelected(0). OnSelect(func(i int, _ string) { themeRef.Set(themes[i].new()) }) freq := ui.Slider(1, 8, 3) amp := ui.Slider(0.1, 1, 0.8) pause := ui.Toggle(false)
var t float64 // seconds the signal has run, so pausing freezes it in place last := time.Now()
build = func() ui.View { now := time.Now() if !pause.Value() { t += now.Sub(last).Seconds() ui.Invalidate() } last = now f, a := float64(freq.Value()), float64(amp.Value())
status := ui.Badge("live") if pause.Value() { status = ui.Badge("paused · drawing nothing").Secondary() } return ui.VStack( ui.HStack(ui.Text("Signal studio").Title(), status, ui.Spacer(), picker).Spacing(12).Center(), ui.Flex(1, ui.Card(ui.Expanded( ui.Polyline(600, func(i int) (x, y float32) { x = float32(i) / 599 return x, float32(0.5 - 0.45*wave(f, a, t, float64(x))) }).StrokeWidth(2.5), ))), ui.HStack(label("Frequency"), ui.Flex(1, freq), ui.Text(fmt.Sprintf("%.1f Hz", f)).Width(56)).Spacing(12).Center(), ui.HStack(label("Amplitude"), ui.Flex(1, amp), ui.Text(fmt.Sprintf("%.0f%%", a*100)).Width(56)).Spacing(12).Center(), ui.HStack(label("Pause"), pause).Spacing(12).Center(), ).Spacing(16).Padding(24) } return build, themeRef}
// label is a control's name, in a fixed width so the controls line up.func label(s string) ui.View { return ui.Text(s).Width(88) }
// wave is the signal at x (0 to 1 across the view) after t seconds: a// tone and its third harmonic, scaled to amp.func wave(freq, amp, t, x float64) float64 { return amp * (0.75*math.Sin(2*math.Pi*freq*x-3*t) + 0.25*math.Sin(6*math.Pi*freq*x+5*t))}
var themes = []struct { name string new func() *theme.Theme}{ {"Catppuccin Mocha", theme.CatppuccinMocha}, {"Catppuccin Latte", theme.CatppuccinLatte}, {"Fluent Dark", theme.FluentDark}, {"Fluent Light", theme.FluentLight}, {"Nord Dark", theme.NordDark}, {"Nord Light", theme.NordLight}, {"Solarized Dark", theme.SolarizedDark}, {"Solarized Light", theme.SolarizedLight}, {"Material Dark", theme.MaterialDark}, {"Material Light", theme.MaterialLight},}// Package form is the ui-form example's app, as a package so that// other programs (the immygo.app demo bundle) can run it. main.go runs it.package form
import ( "fmt"
"github.com/amken3d/immygo/theme" "github.com/amken3d/immygo/ui")
// Main runs the example. It blocks until the window closes.func Main() { name := ui.Input().Placeholder("Full name") email := ui.Input().Placeholder("Email address").OnChange(func(text string) { fmt.Printf("Email: %s\n", text) }) password := ui.Password() role := ui.Dropdown("Developer", "Designer", "Manager").Placeholder("Select role") agreed := ui.Checkbox("I agree to terms", false) submitted := ui.NewState(false)
// Runtime theme switching via ThemeRef. themeRef := ui.NewThemeRef(theme.FluentLight()) darkMode := ui.Toggle(false).OnChange(func(on bool) { if on { themeRef.Set(theme.FluentDark()) } else { themeRef.Set(theme.FluentLight()) } })
ui.Run("Sign Up", func() ui.View { // Conditional: show success or form if submitted.Get() { return ui.Centered( ui.Card( ui.VStack( ui.Text("Welcome!").Headline().Center(), ui.Text(fmt.Sprintf("Hello, %s", name.Value())).Center(), ui.Text(fmt.Sprintf("Email: %s", email.Value())).Small().Center(), ui.Divider(), ui.Button("Back").Outline().OnClick(func() { submitted.Set(false) }), ).Spacing(12).Center(), ).Elevation(2), ) }
return ui.Centered( ui.Card( ui.VStack( ui.Text("Create Account").Title().Center(), ui.Divider(), name, email, password, role, agreed, ui.HStack( ui.Text("Dark mode"), ui.Spacer(), darkMode, ).Center(), ui.Divider(),
// Themed gives access to theme colors anywhere ui.Themed(func(th *theme.Theme) ui.View { return ui.Text("Powered by ImmyGo").Small(). Color(th.Palette.Primary) }),
ui.Button("Sign Up").OnClick(func() { fmt.Printf("Name: %s, Email: %s, Role: %s\n", name.Value(), email.Value(), role.SelectedText()) submitted.Set(true) }), ui.Button("Cancel").Outline(), ).Spacing(12), ).Elevation(2).CornerRadius(12), ) }, ui.Size(500, 600), ui.WithThemeRef(themeRef))}// Package livedata is the live-data example's app: a telemetry dashboard// with four traces scrolling at 60 samples a second over a data grid of// 100,000 rows. It is a package so that other programs (the README GIF// recorder, the immygo.app demo bundle) can run it; main.go runs it.package livedata
import ( "fmt" "math" "strconv" "time"
"github.com/amken3d/immygo/theme" "github.com/amken3d/immygo/ui")
// Rows is the number of rows in the grid.const Rows = 100_000
const samples = 600
var colors = []string{"0078d4", "107c10", "d83b01", "8764b8"}
// signal is a deterministic test signal in [-1, 1].func signal(ch int, t float64) float32 { return float32(math.Sin(t*0.05*float64(ch+1))*0.6 + math.Sin(t*0.013*float64(ch+3))*0.4)}
// Main runs the dashboard in a window. It blocks until the window closes.func Main() { build, th := New() ui.Run("Live telemetry", build, ui.Size(960, 540), ui.Theme(th), ui.ContinuousRedraw())}
// New builds the dashboard. The traces move with wall-clock time, so the// caller must redraw continuously (Main uses ui.ContinuousRedraw).func New() (build func() ui.View, th *theme.Theme) { rows := make([][]string, Rows) for r := range rows { status := "OK" switch { case r%17 == 0: status = "FAULT" case r%5 == 0: status = "WARN" } rows[r] = []string{ commas(r), fmt.Sprintf("axis-%d", r%7), fmt.Sprintf("%.3f mm", float64(r)*0.125), fmt.Sprintf("%.2f mm/s", float64(r%997)*0.5), fmt.Sprintf("%.1f A", float64(r%53)*0.1), status, } } grid := ui.DataGrid( ui.Col("ID"), ui.Col("Axis"), ui.Col("Position"), ui.Col("Velocity"), ui.Col("Current"), ui.Col("Status"), ).Striped(true).Rows(rows)
top := ui.Button("Top").Outline().OnClick(func() { grid.ScrollToRow(0) }) mid := ui.Button("Row 50,000").Outline().OnClick(func() { grid.ScrollToRow(50_000) }) end := ui.Button("End").Outline().OnClick(func() { grid.ScrollToRow(Rows - 1) })
start := time.Now()
chart := func(ch int, t float64) ui.View { return ui.Card(ui.VStack( ui.Text(fmt.Sprintf("Channel %d", ch+1)).Caption(), ui.Polyline(samples, func(k int) (x, y float32) { v := signal(ch, t-float64(samples-1-k)) return float32(k) / float32(samples-1), 0.5 - 0.45*v }).Color(ui.Hex(colors[ch])).StrokeWidth(1.5).Height(64), ).Spacing(4)) }
build = func() ui.View { t := time.Since(start).Seconds() * 60 // samples charts := make([]ui.View, len(colors)) for ch := range charts { charts[ch] = ui.Flex(1, chart(ch, t)) } first, n := grid.VisibleRows() status := fmt.Sprintf("Rows %s–%s of %s", commas(first+1), commas(min(first+n, Rows)), commas(Rows)) return ui.VStack( ui.HStack( ui.Text("Live telemetry").Title(), ui.Spacer(), ui.Badge(commas(Rows)+" rows"), ui.Badge(fmt.Sprintf("%d × %d samples", len(colors), samples)).Secondary(), ).Spacing(8).Center(), ui.HStack(charts...).Spacing(12), ui.Flex(1, grid), ui.HStack(ui.Text(status).Small(), ui.Spacer(), top, mid, end).Spacing(8).Center(), ).Spacing(12).Padding(16) } return build, theme.FluentLight()}
// commas formats n with thousands separators.func commas(n int) string { s := strconv.Itoa(n) for i := len(s) - 3; i > 0; i -= 3 { s = s[:i] + "," + s[i:] } return s}go get github.com/amken3d/immygoWhy ImmyGo
Declarative Go
Describe the screen as plain Go values: stacks, text, buttons, grids. State changes redraw what changed. No code generation, no markup language, no separate UI toolchain.
Fast to build and to run
Rebuilds take seconds with go build. Every shape and glyph is drawn on the GPU, and an idle window draws nothing at all.
Batteries included
Data grids, charts, forms, dialogs, a node-graph canvas, Fluent and Catppuccin themes, and AI helpers, in one small native binary.
- 76 ms
- to first frame
- 13.4 MB
- binary
- 1–6 s
- release build
- 0.2%
- CPU when idle
Measured with the uibench benchmark on an Intel i5-12600KF, Linux.
Instead of Electron or Tauri
- No browser engine. Nothing to bundle, and no web view that behaves differently on each platform.
- One language. Your UI is Go, like the rest of your app. No HTML, CSS or JavaScript, and no Rust.
- Idle means idle. 0.2% CPU when nothing changes; first frame in 76 ms.
Compared with Zed GPUI
GPUI is the Rust framework behind the Zed editor. We wrote the same four-scene app in both and ran them on one machine. Here are the two apps, recorded running the same script: eight live charts, a 100,000-row grid scrolling, 1,200 cells changing every frame, then idle.
| ImmyGo | GPUI | |
|---|---|---|
| Frame rate, three animated scenes | 60 fps | 60 fps |
| Startup to first frame | 76 ms | 128 ms |
| Binary size | 13.4 MB | 27.6 MB |
| Release build of the benchmark app | 1–6 s | 74–110 s |
| CPU when idle | 0.2% | 0.4% |
| CPU per frame, dashboard with 8 live charts | 3.8 ms | 2.4 ms |
| CPU per frame, 100,000-row grid scrolling | 1.6 ms | 1.1 ms |
| CPU per frame, 1,200 cells changing | 9.2 ms | 4.3 ms |
| Peak memory | 207 MB | 170 MB |
ImmyGo starts faster, builds faster and ships a binary half the size. GPUI does less work per frame and uses less memory. Conditions and caveats: Performance.
What you get
Quick start
- Add ImmyGo to a Go module:
go get github.com/amken3d/immygo - Write
main.go. - Run it:
go run .
Go 1.26 or later. On Linux, Gio needs the usual X11/Wayland and Vulkan development headers; see Getting started.
package main
import ( "fmt"
"github.com/amken3d/immygo/ui")
func main() { count := ui.NewState(0) ui.Run("Counter", func() ui.View { return ui.Centered(ui.VStack( ui.Text(fmt.Sprintf("Clicked %d times", count.Get())).Title(), ui.Button("Click me").OnClick(func() { count.Update(func(n int) int { return n + 1 }) }), ).Spacing(12).Center()) })}