Let's Explore GUI Options for Nim
The details in this post are not likely to be kept up to date. It's just a starting point for your own research.
Nim is still a fringe programming language, so unfortunately the tl;dr is that there are no booming, mature options for creating a native GUI with Nim. There are a handful of efforts being made toward this end, with various degrees of success and ongoing effort. I've chosen to run with NiGui for now, for simple interfaces, as it does not yet have the support for more complex elements or layouts but is simple to use for very basic GUIs.
I don't pretend to be an expert in GUI development, or in Nim, so in this post I'm mostly attempting to outline objective facts about each option to give an at-a-glance perspective of the state of GUI development with Nim.
NiGui
Repo: GitHub
Platforms: Windows, macOS, Linux
Native: yes
License: MIT
Last Commit: 12/3/20
Commits in Last Year: 164
Notes: Minimal (but functional) number of GUI elements. Responsive developer.
wxnim
Repo: GitHub
Platforms: Windows, macOS, Linux
Native: no
GUI Toolkit: wxWidgets
License: MIT (wxWidgets uses an L-GPL like license)
Last Commit: 11/16/20
Commits in Last Year: 8
Notes: An older version of wxnim was originally reported here, but PMunch maintains an up to date fork with many improvements.
wNim
Repo: GitHub
Platforms: Windows
Native: yes
License: MIT
Last Commit: 11/23/20
Commits in Last Year: 115
Notes:
NimQML
Repo: GitHub
Platforms: Windows, macOS, Linux, Android, iOS
Native: no
GUI Toolkit: Qt QML
License: LGPL
Last Commit: 10/1/19
Commits in Last Year: 11
Notes: Decent beginner documentation and examples
nuklear-nim
Repo: GitHub
Platforms: Windows, macOS, Linux, Android, iOS
Native: no
GUI Toolkit: nuklear
License: none listed on bindings; nuklear is MIT
Last Commit: 7/10/19
Commits in Last Year: 5
Notes:
ui
Repo: GitHub
Platforms: Windows, macOS, Linux
Native: no (libui is not really clear whether it's native or uses custom controls)
GUI Toolkit: libui
License: MIT
Last Commit: 10/19/19
Commits in Last Year: 20
Notes: Built by the Nim team.
nimx
Repo: GitHub
Platforms: Windows, macOS, Linux, Android, iOS, Javascript
Native: no
License: MIT
Last Commit: 11/30/20
Commits in Last Year: 152
Notes:
iup
Repo: GitHub
Platforms: Windows, Linux
Native: no
GUI Toolkit: IUP
License: MIT
Last Commit: 11/4/19
Commits in Last Year: 3
Notes: Built by the Nim team.
Other Options
All "Commits in Last Year" are updated as of 4/1/2019.
The data was pulled from the GitHub GraphQL API. You can see the same using their explorer and the following query.
{
nigui: repository(owner: "trustable-code", name: "nigui") {
...RepoFragment
}
wxnim: repository(owner: "araq", name: "wxnim") {
...RepoFragment
}
wnim: repository(owner: "khchen", name: "wnim") {
...RepoFragment
}
nimqml: repository(owner: "filcuc", name: "nimqml") {
...RepoFragment
}
nuklear: repository(owner: "zacharycarter", name: "nuklear-nim") {
...RepoFragment
}
ui: repository(owner: "nim-lang", name: "ui") {
...RepoFragment
}
nimx: repository(owner: "yglukhov", name: "nimx") {
...RepoFragment
}
iup: repository(owner: "nim-lang", name: "iup") {
...RepoFragment
}
}
fragment RepoFragment on Repository {
name
defaultBranchRef {
name
target {
... on Commit {
id
yearCommits: history(since:"2018-04-01T01:01:00") {
totalCount
}
lastCommit: history(first:1){
pageInfo {
hasNextPage
endCursor
}
edges {
node {
authoredDate
}
}
}
}
}
}
}
If you would like me to include any additional libraries here, or to update information on existing libraries, please email mwhager87 [at] gmail.