3 ms·
In a nutshell, the Tk GUI, to my understanding, is basically a C GUI library. A lot of its widget code is written in Tcl, so that using Tk in an application req
by kazinator 8y ago
In a nutshell, the Tk GUI, to my understanding, is basically a C GUI library. A lot of its widget code is written in Tcl, so that using Tk in an application requires embedding the Tcl interpreter.
Using Tk, but replacing that Tcl interpreter with one's own is likely possible, but almost certainly a big project, possibly resulting in a complicated fork of Tk.
So simply bringing back Tk wouldn't do anything without a lot of additional work. One simpler possibility, though, would be to have a delegating API in the OTPCL which just forwards down to the Tcl/Tk, so that it would look like OTPCL is integrated with Tk.
- yellowapple 8y agoIndeed; OTPCL already diverges significantly from Tcl in very important ways that would be very hard to change while still maintaining some semblance of compatibility with Erlang and the broader ecosystem thereof; if I were to literally integrate Tk itself, that would indeed be... involved. I do like the idea of delegating to actual Tcl for a Tcl/Tk bridge, at least for something quick-and-dirty; a run-of-the-mill Erlang "port" written in Tcl ought to be an effective first pass at going about that. It should be easy to do. In the longer term, a toolkit geared specifically toward Erlang's strengths (e.g. each widget having its own process, message passing instead of callbacks, etc.) seems like it'd be a more valuable contribution to the Erlang ecosystem, even if it'd be harder than even trying to bridge OTPCL with Tk directly. Ideally OTPCL/$TOOLKIT should be as dead-simple to use as Tcl/Tk (and should be straightforward even if you swap out the "OTPCL" part of that with Erlang/Elixir/LFE/Joxa/LuErl/ErLog/etc.).