Re:GTK4 Bindings for Common Lisp
by tabtab on Tuesday September 20, 2022 @02:20PM
(#32915785)
It's not good D.R.Y. to reinvent a binding library for each and every application language. What's needed is a state-ful GUI markup standard. Then any language that can emit and read XML can use the GUI kit/browser/component, no binders needed.
[ Parent
| on HN ]
What you're describing is GObject inspection. It's literally a series of XML documents that can be used to autogenerate ffi bindings in any language. The future is now.
...which is literally what these Lisp bindings use.
No one will want to write GUI code that directly parses and generates XML, so every language will end up putting wrappers around that, and you are back to where you started with an expensive translation layer in-between.
Having a machine format that describes the interface and facilitates auto-generating the bindings, like GObject introspection is a better option and exists today. Even then the auto-generator will need to be custom for each language, to handle integration with the language's standard library data structures, memory management and the like.
> XML User Interface Language is a user interface markup language developed by Mozilla. XUL is an XML dialect for writing graphical user interfaces, enabling developers to write user interface elements in a manner similar to web pages.
Re:GTK4 Bindings for Common Lisp
by JasonFruit on Tuesday September 20, 2022 @02:38PM
(#32916024)
That way, your language can use any toolkit, such as WebKit or Gecko.
Re:GTK4 Bindings for Common Lisp
by spicybright on Tuesday September 20, 2022 @04:26PM
(#32917326)
If you did that, you limit what the API of a framework can do, you either can't use ones that fall outside that spec, or you have to jump through hacky hoops to get it working.
Experienced engineers know D.R.Y. has it's uses, but isn't a good hill to die on.
What's the advantage? This merely seems to add another layer of abstraction.