site  contact  subhomenews

ui GUI toolkit for Nim

August 30, 2022 — BarryK

Starting to look at GUI toolkits for Nim. Lots to choose from:

That isn't a complete list. I found more, some of them inactive projects.

Made a start, looked at 'ui':

ui is a wrapper for 'libui', which started life as a GUI toolkit for the 'go' language (libui is a wrapper for gtk3):

Here is an example from the 'ui' project, 'controllgallery.nim':


Now here is the great news; the binary executable, after stripping, is only 27KB. That is using '', which is 187KB. Here is how I compiled 'controllgallery.nim':

# nim c -d:release --opt:size -d:useLibUiDll -d:useMalloc --mm:orc --passC:-flto --passL:-flto controllgallery

That "-d:useLibUiDll" tells nim to link with the shared, instead of static linking. The source code looks very simple:

Definitely a contender!    

Tags: easy