Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
ccbda82
feat: basic golang implementation (wip)
jclab-joseph Apr 8, 2026
6ae9dee
fix: use SLINT_GOOS/SLINT_GOARCH instead of GOOS/GOARCH
jclab-joseph Apr 9, 2026
d12dd3f
fix: remove test code
jclab-joseph Apr 9, 2026
030166b
fix: move api/go/go.mod into go.mod
jclab-joseph Apr 9, 2026
e2d7d2d
fix: use minimal go version 1.21 for slices package
jclab-joseph Apr 9, 2026
84594bd
fix: use minimal go version 1.23 for strings package
jclab-joseph Apr 9, 2026
dafa5f8
fix: use release default
jclab-joseph Apr 9, 2026
3359987
fix: lint
jclab-joseph Apr 9, 2026
8a4cdf6
[autofix.ci] apply automated fixes
autofix-ci[bot] Apr 9, 2026
f4793a5
docs: add golang information
jclab-joseph Apr 9, 2026
e26398b
refactor
jclab-joseph Apr 9, 2026
d51d6d0
ci: golang test
jclab-joseph Apr 9, 2026
4f249fa
fix for windows
jclab-joseph Apr 9, 2026
e18f483
fix: lint
jclab-joseph Apr 9, 2026
777a8f5
feat: support build features option
jclab-joseph Apr 9, 2026
23a003e
ci: add go-version
jclab-joseph Apr 9, 2026
9a8fa10
fix
jclab-joseph Apr 9, 2026
77e0831
go-driver test and fix
jclab-joseph Apr 10, 2026
98df5f0
[autofix.ci] apply automated fixes
autofix-ci[bot] Apr 10, 2026
c7cf855
fix: add missed go.sum
jclab-joseph Apr 10, 2026
84b37cf
fix: lint
jclab-joseph Apr 10, 2026
bd156ff
fix: test_go_lookup_rust_names,test_go_types_enums,test_go_types_stri…
jclab-joseph Apr 10, 2026
a04bcb8
test: add backend-winit,renderer-software features for windows
jclab-joseph Apr 10, 2026
afac2b1
fix: concurrently issue
jclab-joseph Apr 10, 2026
a30aed6
test: fix for windows
jclab-joseph Apr 10, 2026
df33f99
fix: InitTestingBackend
jclab-joseph Apr 10, 2026
b97160a
test: fix windows test
jclab-joseph Apr 10, 2026
f8b74ae
fix: link error
jclab-joseph Apr 10, 2026
47deaa6
[autofix.ci] apply automated fixes
autofix-ci[bot] Apr 10, 2026
5229a10
fix: link error on macos
jclab-joseph Apr 10, 2026
d0484a1
refactor: callback
jclab-joseph Apr 13, 2026
42fc8cb
fix: rename argument
jclab-joseph Apr 13, 2026
7194842
tests: add go tests
jclab-joseph Apr 13, 2026
8e6bf51
[autofix.ci] apply automated fixes
autofix-ci[bot] Apr 13, 2026
28f29ee
fix: implement enum and more tests
jclab-joseph Apr 16, 2026
8587b66
test: use readonly-cache on testing (Avoid test failures due to insuf…
jclab-joseph Apr 16, 2026
b504b3c
feat: error return & lock thread
jclab-joseph Apr 16, 2026
bfd22c7
fix test
jclab-joseph Apr 16, 2026
83c884c
fix(macos): add cocoa framework
jclab-joseph Apr 16, 2026
0299797
fix and tests
jclab-joseph Apr 16, 2026
34c7927
[autofix.ci] apply automated fixes
autofix-ci[bot] Apr 16, 2026
1a65cfd
support struct and tests
jclab-joseph Apr 17, 2026
d2e8f35
add tests
jclab-joseph Apr 17, 2026
02d5ace
lint
jclab-joseph Apr 17, 2026
3f614b7
add tests
jclab-joseph Apr 17, 2026
7cb443a
chore(deps): update cargo.lock
jclab-joseph Apr 17, 2026
915342f
fix: test
jclab-joseph Apr 17, 2026
7d223fb
testing: fix font
jclab-joseph Apr 17, 2026
aba0345
fix (rust-cpp-docs,cpp_cmake)
jclab-joseph Apr 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/ci_path_filters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ api_node:
- *js_config
- *ci_config

api_go:
- 'api/go/**'
- 'tools/compiler/**'
- *ci_config

api_rs:
- 'api/rs/**'
- 'Cargo.toml'
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/build_and_test_reusable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ jobs:
# Ignore rust_version for stable/nightly to test with latest dependencies
run: cargo update ${{ (inputs.rust_version == 'stable' || inputs.rust_version == 'nightly') && '--ignore-rust-version' || '' }}
- name: Run tests
run: "cargo test --locked --verbose --all-features --workspace --timings ${{ inputs.extra_args }} --exclude slint-node --exclude pyslint --exclude test-driver-node --exclude slint-node --exclude test-driver-nodejs --exclude test-driver-cpp --exclude test-driver-python --exclude mcu-board-support --exclude mcu-embassy --exclude printerdemo_mcu --exclude uefi-demo --exclude slint-cpp --exclude slint-python -- --skip=qt::"
run: "cargo test --locked --verbose --all-features --workspace --timings ${{ inputs.extra_args }} --exclude slint-node --exclude pyslint --exclude test-driver-node --exclude slint-node --exclude test-driver-nodejs --exclude test-driver-cpp --exclude test-driver-python --exclude test-driver-go --exclude mcu-board-support --exclude mcu-embassy --exclude printerdemo_mcu --exclude uefi-demo --exclude slint-cpp --exclude slint-python -- --skip=qt::"
env:
SLINT_CREATE_SCREENSHOTS: 1
shell: bash
- name: Run tests (qt)
if: runner.os != 'Windows'
run: "cargo test --locked --verbose --all-features --workspace ${{ inputs.extra_args }} --exclude slint-node --exclude pyslint --exclude test-driver-node --exclude slint-node --exclude test-driver-nodejs --exclude test-driver-cpp --exclude test-driver-python --exclude mcu-board-support --exclude mcu-embassy --exclude printerdemo_mcu --exclude uefi-demo --exclude slint-cpp --exclude slint-python qt:: -- --test-threads=1"
run: "cargo test --locked --verbose --all-features --workspace ${{ inputs.extra_args }} --exclude slint-node --exclude pyslint --exclude test-driver-node --exclude slint-node --exclude test-driver-nodejs --exclude test-driver-cpp --exclude test-driver-python --exclude test-driver-go --exclude mcu-board-support --exclude mcu-embassy --exclude printerdemo_mcu --exclude uefi-demo --exclude slint-cpp --exclude slint-python qt:: -- --test-threads=1"
shell: bash
- name: live-preview for rust test
env:
Expand All @@ -139,4 +139,3 @@ jobs:
- name: Print Disk Usage
if: always()
run: df -h

25 changes: 25 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
api_cpp : ${{ steps.filter.outputs.api_cpp }}
api_python : ${{ steps.filter.outputs.api_python }}
api_node : ${{ steps.filter.outputs.api_node }}
api_go : ${{ steps.filter.outputs.api_go }}
api_rs : ${{ steps.filter.outputs.api_rs }}
tests : ${{ steps.filter.outputs.tests }}
examples : ${{ steps.filter.outputs.examples }}
Expand Down Expand Up @@ -136,6 +137,30 @@ jobs:
name: "Python Windows"
os: "windows-2022"

go_test_linux:
needs: files-changed
if: needs.files-changed.outputs.internal == 'true' || needs.files-changed.outputs.api_go == 'true' || needs.files-changed.outputs.tests == 'true'
uses: ./.github/workflows/go_test_reusable.yaml
with:
name: "Go Linux"
os: "ubuntu-22.04"

go_test_macos:
needs: files-changed
if: needs.files-changed.outputs.api_go == 'true' || needs.files-changed.outputs.tests == 'true'
uses: ./.github/workflows/go_test_reusable.yaml
with:
name: "Go macOS"
os: "macos-14"

go_test_windows:
needs: files-changed
if: needs.files-changed.outputs.api_go == 'true' || needs.files-changed.outputs.tests == 'true'
uses: ./.github/workflows/go_test_reusable.yaml
with:
name: "Go Windows"
os: "windows-2022"

cpp_test_driver:
needs: files-changed
if: needs.files-changed.outputs.internal == 'true' || needs.files-changed.outputs.api_cpp == 'true' || needs.files-changed.outputs.tests == 'true'
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/go_test_reusable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Copyright © SixtyFPS GmbH <info@slint.dev>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0

name: Go Test (Reusable)

on:
workflow_call:
inputs:
name:
description: 'Name of the job'
required: true
type: string
os:
description: 'Operating system to run on'
required: true
type: string

env:
RUSTFLAGS: -D warnings
CARGO_PROFILE_DEV_DEBUG: 0
CARGO_INCREMENTAL: false
RUST_BACKTRACE: 1


jobs:
go_test:
name: ${{ inputs.name }}
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/install-linux-dependencies
- uses: ./.github/actions/install-skia-dependencies
- name: Setup headless display
if: runner.os != 'macOS'
uses: pyvista/setup-headless-display-action@v4
- uses: actions/setup-go@v6
id: go-install
with:
go-version: '1.26'
- uses: ./.github/actions/setup-rust
with:
key: x-go-v0-${{ steps.go-install.outputs.go-version }}
target: ${{ runner.os == 'Windows' && 'x86_64-pc-windows-gnu' || '' }}
- name: Run Go package tests
working-directory: api/go
run: go test ./...
- name: Prebuild slint-cpp for Go test driver
if: runner.os == 'Windows'
run: cargo build --verbose -p slint-cpp --target x86_64-pc-windows-gnu --no-default-features --features interpreter,testing,backend-testing
- name: Run Go test driver
run: ${{ runner.os == 'Windows' && 'cargo test --verbose -p test-driver-go --target x86_64-pc-windows-gnu' || 'cargo test --verbose -p test-driver-go' }}
- name: Generate Go example
working-directory: examples/go/hello
env:
SLINT_FEATURES: ${{ runner.os == 'Windows' && 'backend-winit,renderer-software' || '' }}
run: go generate
- name: Build Go example dynamically
working-directory: examples/go/hello
env:
CGO_ENABLED: "1"
run: go build -o slint-shared .
- name: Build Go example statically
working-directory: examples/go/hello
env:
CGO_ENABLED: "1"
run: go build -o slint-static -tags slint_static .
9 changes: 9 additions & 0 deletions .github/workflows/nightly_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,15 @@ jobs:
name: "Node.js ${{ matrix.os }}"
os: ${{ matrix.os }}

go:
strategy:
matrix:
os: [ubuntu-22.04, macos-14, windows-2022]
uses: ./.github/workflows/go_test_reusable.yaml
with:
name: "Go ${{ matrix.os }}"
os: ${{ matrix.os }}

miri:
runs-on: ubuntu-latest
steps:
Expand Down
36 changes: 24 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ members = [
'tests/doctests',
'tests/driver/cpp',
'tests/driver/driverlib',
'tests/driver/go',
'tests/driver/interpreter',
'tests/driver/nodejs',
'tests/driver/python',
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

**Slint** is an open-source declarative GUI toolkit for building native user interfaces for embedded systems, desktops, and mobile platforms.

Write your UI once in `.slint`, a simple markup language. Connect it to business logic written in Rust, C++, JavaScript, or Python.
Write your UI once in `.slint`, a simple markup language. Connect it to business logic written in Rust, C++, JavaScript, Python, or Go.

## Why Slint?

Expand Down Expand Up @@ -103,11 +103,16 @@ Refer to the README of each language directory in the `api` folder:
- [Rust](api/rs/slint) [![Crates.io][#18]][#19] ([Documentation][#20] | [Tutorial Video][#22] | [Getting Started Template][#23])
- [JavaScript/NodeJS (Beta)](api/node) [![npm][#24]][#25] ([Documentation][#26] | [Getting Started Template][#28])
- [Python (Beta)](api/python/slint) [![pypi][#31]][#32] ([Documentation][#33] | [Getting Started Template][#34])
- [Go (Experimental)](api/go) ([Hello Example](examples/go/hello))

The Go bindings use `go generate` to compile `.slint` files into Go wrappers. For cross-generation,
set `SLINT_GOOS` and `SLINT_GOARCH` instead of `GOOS` and `GOARCH`, so the generator itself still runs
on the host architecture.

## Architecture

An application is composed of the business logic written in Rust, C++, or
JavaScript and the `.slint` user interface design markup, which is compiled to
An application is composed of the business logic written in Rust, C++, JavaScript,
Python, or Go and the `.slint` user interface design markup, which is compiled to
native code.

![Architecture Overview](https://slint.dev/resources/architecture.drawio.svg)
Expand All @@ -122,7 +127,7 @@ unchanged.
The compiler uses the typical compiler phases of lexing, parsing, optimization,
and finally code generation. It provides different back-ends for code generation
in the target language. The C++ code generator produces a C++ header file, the
Rust generator produces Rust code, and so on. An interpreter for dynamic
Rust generator produces Rust code, the Go generator produces Go code, and so on. An interpreter for dynamic
languages is also included.

### Runtime
Expand Down Expand Up @@ -181,7 +186,7 @@ Please see our separate [FAQ](FAQ.md).

We are passionate about software - API design, cross-platform software
development and user interface components. Our aim is to make developing user
interfaces fun for everyone: from Python, JavaScript, C++, or Rust developers all the
interfaces fun for everyone: from Python, JavaScript, Go, C++, or Rust developers all the
way to UI/UX designers. We believe that software grows organically and keeping
it open source is the best way to sustain that growth. Our team members are
located remotely in Germany, Finland, and US.
Expand Down
4 changes: 4 additions & 0 deletions REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ path = [
"pnpm-lock.yaml",
"rustfmt.toml",
"*.md",
"go.mod",
"go.sum",
]
precedence = "aggregate"
SPDX-FileCopyrightText = "Copyright © SixtyFPS GmbH <info@slint.dev>"
Expand Down Expand Up @@ -133,6 +135,8 @@ path = [
"examples/orbit-animation/images/**.svg",
"examples/sprite-sheet/images/**.png",
"examples/speedometer/needle.png",
"examples/**/.gitkeep",
"examples/**/*.slint.go",

"demos/printerdemo/ui/images/action-button-frame.png",
"demos/printerdemo/ui/images/mcu/combo-active-background.png",
Expand Down
1 change: 1 addition & 0 deletions api/cpp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ interpreter = ["slint-interpreter", "std"]
live-preview = ["interpreter", "slint-interpreter/internal-live-preview"]
# Enable some function used by the integration tests
testing = ["dep:i-slint-backend-testing"]
backend-testing = ["i-slint-backend-selector/backend-testing"]

backend-qt = ["i-slint-backend-selector/backend-qt", "std"]
backend-winit = ["i-slint-backend-selector/backend-winit", "std"]
Expand Down
1 change: 1 addition & 0 deletions api/cpp/cbindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,7 @@ fn gen_interpreter(
"ComponentInstance",
"StructIteratorResult",
"Value",
"SlintGoValueSlice",
"StructOpaque",
"ModelNotifyOpaque",
])
Expand Down
Loading
Loading