[HN Gopher] Tk9.0: CGo-free, cross platform GUI toolkit for Go
       ___________________________________________________________________
        
       Tk9.0: CGo-free, cross platform GUI toolkit for Go
        
       Author : nateb2022
       Score  : 110 points
       Date   : 2024-11-28 15:18 UTC (7 hours ago)
        
 (HTM) web link (pkg.go.dev)
 (TXT) w3m dump (pkg.go.dev)
        
       | nateb2022 wrote:
       | Includes beautiful modern themes, e.g. azure
       | https://pkg.go.dev/modernc.org/tk9.0@v0.53.0/themes/azure
        
       | baq wrote:
       | Figma killed the desktop app. I yearn for the good old days of
       | standardized UI if I actually need to get shit done efficiently.
       | Nowadays it's learning everything from either scratch; maybe if
       | you're lucky, the designer put in some 'intuitive' (read
       | 'fashionable') interactions.
        
         | Aurornis wrote:
         | The Tk GUI toolkit dates back to 1991.
         | 
         | This style of GUI predates Figma by decades.
        
         | kristianp wrote:
         | Yeah, web dev sucks.
        
         | Shorel wrote:
         | You write like you were born after all the events related to
         | the desktop application had run their curse.
         | 
         | We killed the desktop app, to free ourselves from the Wintel
         | monopoly. We pushed the migration to the Web, because that was
         | the unreachable niche for Microsoft and their monopolistic
         | practices.
         | 
         | We succeeded, and as punishment, now we have to endure all
         | these applications written in Node.js with Electron UIs. We
         | won, but we have paid a high price for it.
         | 
         | In this context, Figma is nothing more than an afterthought.
         | Something that appeared as a consequence, not the cause of
         | anything.
        
           | oblio wrote:
           | Don't worry, mobile applications, which are basically another
           | nightmare, are slowly eating the web for general
           | purpose/public applications.
           | 
           | And now we have 2 oligopolies instead of 1 monopoly, but in
           | practice it's basically the same thing.
        
           | fuzztester wrote:
           | >You write like you were born after all the events related to
           | the desktop application had run their curse.
           | 
           | >We killed the desktop app, to free ourselves from the Wintel
           | monopoly.
           | 
           | Bombastic nonsensical crap!
           | 
           | "We" didn't kill anything. and "we" were not slaves in the
           | first place, so "we" didn't need to make ourselves free.
           | 
           | This is not the multiple Oscar-winning award-winning Ben-Hur
           | movie or the Biblical story of the ancient Israelites as
           | slaves in Egypt or something like that.
           | 
           |  _Anyone_ , who wanted to, or at least, any reasonably large
           | group of people, could have moved off, from Windows, _if they
           | wanted to, badly enough_. Say a few thousand people. As an
           | example, they could have collected donations, and hired 10 to
           | 50 smart computer science students, grad or undergrad, and  /
           | or professors and / or operating system developers, to create
           | a better OS without the monopoly and bad practices of MS.
           | 
           | Maybe you and some known to you did. don't generalize
           | vacuously.
           | 
           | There is no "we", period.
           | 
           | That is a fallacy that we imposed upon ourselves.
           | 
           | We pushed the migration to the Web, because that was the
           | unreachable niche for Microsoft and their monopolistic
           | practices.
        
       | oblio wrote:
       | He he, is this based on Tcl? It for sure seems at least inspired
       | by Tcl/Tk.
        
         | tecleandor wrote:
         | And latest Tcl/Tk is v9 I think. So I guess there should be
         | something...
        
         | felixr wrote:
         | These are Go bindings for Tk, a cross-platform widget toolkit
         | initially developed as extension for Tcl. Nowadays a lot of
         | languages have bindings for Tcl/Tk. Python for example has been
         | including tkinter [0] for a long time.
         | 
         | [0]: https://docs.python.org/3/library/tkinter.html
        
           | Pet_Ant wrote:
           | Really? Would love to see a binding for Powershell. Just for
           | cross-platform shell scripts to be able to disable a pop-up
           | for input etc. Just makes them more accessible.
        
           | fuzztester wrote:
           | yes, perl, python and ruby, for example.
        
           | fuzztester wrote:
           | yes, for python, from 1.5 or early 2.x versions onwards,
           | iirc. I've used py a bit from 1.5 and much more from early
           | 2.x, is how i know this.
        
         | dlachausse wrote:
         | Similarly to Python Tkinter, it actually embeds Tcl/Tk and
         | provides a Go interface to it.
        
       | tecleandor wrote:
       | Edit: CORRECTION! This is a person that used to use the cznic
       | nickname, maybe because they worked in CZNIC for a while, but now
       | goes by "modernc"
       | 
       | Seems like they've been involved in transpiling C projects, like
       | TCK, to Go.
       | 
       | Some context: https://news.ycombinator.com/item?id=33197603
       | 
       | ==previous message before my edit==
       | 
       | Oh, seems like this is made by CZNIC, the org that admins .cz
       | TLD.
       | 
       | They've also done the Omnia Turris routers, KNOT DNS server or
       | BIRD routing daemon...
        
         | duskwuff wrote:
         | > Seems like they've been involved in transpiling C projects,
         | like TCK, to Go.
         | 
         | Probably best known for their port of SQLite:
         | https://pkg.go.dev/modernc.org/sqlite
        
       | wjholden wrote:
       | I'm really impressed that it can render math from TeX input. Is
       | this a common thing in GUI toolkits? My graphics experience is
       | mostly limited to Java's Swing and OpenGL from my college days.
        
         | fweimer wrote:
         | Apparently it's embedding actual TeX for this purpose:
         | https://git.sr.ht/~sbinet/star-tex (TeX is written in a Pascal
         | variant, and this kind of transpilation is by no means
         | unusual.)
         | 
         | It's common to have HTML widgets in GUI toolkits, and some may
         | even support MathML, but this here is a bit different.
        
       | kristopolous wrote:
       | That motif toolkit with the detachable pulldowns and diamond
       | shaped radios...
       | 
       | I know tk has moved on but I have not.
        
         | systems wrote:
         | detachable menus is an undervalued feature, being able to
         | detach a menu or submenu and cycle through its element, is
         | great to have when you need it
        
           | kristopolous wrote:
           | There's a bunch of innovative things that just didn't go
           | through enough design cycles to get the flow right which have
           | since been abandoned
        
       | cyberax wrote:
       | Oh wow! This is super-cool.
       | 
       | It's too ugly for "general-purpose" apps, but it looks to be
       | perfect for internal management apps (control panels, tools). I'm
       | definitely going to try it for my key-management server.
        
       | Shorel wrote:
       | Back in the day, I used to really dislike anything TK related. It
       | looked old and ugly.
       | 
       | Now it looks like a wonderful alternative to all the bloated,
       | wasteful, Electron JS applications out there.
        
       | rob74 wrote:
       | Hm... the examples look nice, but there are several examples that
       | render graphics and/or text on a canvas. How about demonstrating
       | more complex controls, e. g. list views?
        
       | hajimuz wrote:
       | CGO free. TK. I'm sold. imgui user.
        
       | drbig wrote:
       | Tk! Some things just work. Never underestimate proven tech.
        
       | koito17 wrote:
       | How does this avoid Cgo? In the case of Ltk (FFI-free, Common
       | Lisp bindings for Tcl/Tk), I know that the library communicates
       | strings to a Tcl interpreter. This means no FFI is involved, but
       | it does mean the user must have Tcl -- specifically, wish --
       | installed. Is there a similar requirement for this library?
       | 
       | Unfortunately, GitLab is locked behind Cloudflare turnstile and I
       | can't access the source code.
        
       | tonymet wrote:
       | how does this handle state management and event delegation? As
       | in, when state is modified in one control , it instantly updates
       | in the other controls.
       | 
       | The examples show how to draw controls, but that's the easiest
       | and least interesting part of GUI apps
        
       | echoangle wrote:
       | As someone who doesn't know a lot about go: why is CGo-free a
       | feature? In what situations is CGo (which is basically just
       | calling C libs from go, right?) bad?
        
         | cedws wrote:
         | FFI is an additional headache. Instead of having a single
         | hermetic build process that just works, with FFI you now have
         | to deal with shared libraries which may or may not be present,
         | and may or may not support all the architectures or operating
         | systems you want to target. FFI is why so many Python projects
         | blow up when you run pip install. Then it takes sometimes hours
         | to untangle that horror show.
        
       ___________________________________________________________________
       (page generated 2024-11-28 23:00 UTC)