5 ms·
I've looked into it a bit. The answer appears to be… sort of. It depends on your definition of "modern," how many hoops you're willing to jump through, and whic
by m48 11y ago
I've looked into it a bit. The answer appears to be… sort of. It depends on your definition of "modern," how many hoops you're willing to jump through, and which dialects of Lisp you're willing to use. These are some of the more promising options I found.
For Common Lisp, one of the longer-lasting and best supported options appears to be CAPI, which comes with LispWorks (http://www.lispworks.com/products/capi.html http://www.lispworks.com/products/capi.html), but that costs a grand and is not open source, so that's kind of out of the picture for most people. If you're looking for commercial option that will just work, though, this might be worth investigating. (They seem to have recently released a "hobbyist" version that is only $500, but you can only use it for "non-commercial and non-academic purposes," so I'm not really sure how useful that is.)
Ceramic (http://ceramic.github.io/ http://ceramic.github.io/) lets you use Common Lisp to make desktop web apps using Atom's framework (http://electron.atom.io/ http://electron.atom.io/). While that comes with all the disadvantages of making desktops apps with HTML+CSS+JS, it seems to be one of the more professional and easier to set up options.
If you're using a Java implementation of Common Lisp, such as ABCL (http://abcl.org/ http://abcl.org/), you can presumably use any Java GUI framework. I've heard, however, that using Java libraries is significantly more awkward in ABCL than, say, Clojure, and that you might need to write some Java code to bridge the gap. The main attempt to get that to work I've seen appears to be this framework ( https://common-lisp.net/project/snow/ https://common-lisp.net/project/snow/ )—I'm unaware of any applications actually written like this.
Clozure CL (not to be confused with Clojure) has bindings to Apple's Cocoa framework (http://trac.clozure.com/ccl/wiki/CocoaBridge http://trac.clozure.com/ccl/wiki/CocoaBridge). Apparently there's a fairly battle tested cross-platform implementation of Cocoa that you can use to make it run on Windows and Linux too, but I'm having trouble finding a link to that right now. I think it was the framework used to port Comic Life to Windows, if that helps. Regardless, though, this sounds like a pretty scary option for someone without prior Cocoa experience.
Most of the more practical looking options I found seemed to be for Scheme.
Racket (https://racket-lang.org/ https://racket-lang.org/) comes with a GUI toolkit that was originally forked from wxWidgets. The IDE is built in it, among other things. It has some quirks that wxWidgets doesn't, though—for example, all the widgets are native except for all text entry controls, which makes accessibility… interesting. (Also, on my computer, at least, they don't quite cooperate with high DPI displays.)
Chicken Scheme apparently has good bindings to IUP (http://wiki.call-cc.org/eggref/4/iup http://wiki.call-cc.org/eggref/4/iup, http://webserver2.tecgraf.puc-rio.br/iup/ http://webserver2.tecgraf.puc-rio.br/iup/), a fairly lightweight framework that uses native widgets on Windows and Motif/GTK on Linux/Unix/OS X. I wouldn't really call it modern, but it does look fairly convenient—the Scheme API seems to basically let you define GUIs in structured s-expressions (http://wiki.call-cc.org/iup-tutor#porting-some-examples-from-the-iup-distribution http://wiki.call-cc.org/iup-tutor#porting-some-examples-from...). (Also, I'm pretty sure it does support Unicode, and that the IUP site is just out of date.) This is the option I'm leaning towards learning.
Kawa Scheme runs on Java, providing the same benefits as ABCL, but it seems a little more battle tested, and provides native support for making Android applications (http://www.gnu.org/software/kawa/Android-view-construction.html http://www.gnu.org/software/kawa/Android-view-construction.h...). It's used to, among other things, power MIT App Inventor. (You can actually unzip App Inventor projects and find Scheme files inside, which is kind of fun. I kind of wish the App Inventor team would make the framework more accessible from Scheme. :p)
And, of course, if you're willing to settle for dialects of Lisp more distant from Common Lisp or Scheme, you can use Hy and any Python GUI framework (http://docs.hylang.org/en/latest/ http://docs.hylang.org/en/latest/), or Clojure and anything Java.
Hopefully there are some good ones I missed, because Lisp-like languages seem like they would be pretty cool for GUIs.
- jarcane 11y agoOooh. thanks for the link on Chicken Scheme. I've been looking for ages for a more declarative-style GUI framework in a Scheme and I really like the look of that s-exp syntax.
- vram22 11y ago> because Lisp-like languages seem like they would be pretty cool for GUIs. There was also Curl (a language, not the Net lib) some years ago. Tim Berners-Lee was involved in the company as an advisor or something. Around the 2000s, IIRC. Lisp-like in the sense that nested expressions were the main syntax. Had tried it briefly then. Was mainly for web apps though. Acquired later, maybe, by a Japanese company. https://en.m.wikipedia.org/wiki/Curl_(programming_language) https://en.m.wikipedia.org/wiki/Curl_(programming_language) It got a 2008 InfoWorld award in the RIA category.
- soegaard 11y ago> Racket (https://racket-lang.org/ https://racket-lang.org/) comes with a GUI toolkit > that was originally forked from wxWidgets. The GUI was rewritten in 2005 and there are no signs of wxWidgets left (http://blog.racket-lang.org/2010/12/racket-version-5.html http://blog.racket-lang.org/2010/12/racket-version-5.html) There are now native widgets on Windows, OS X, and, Linux. > (Also, on my computer, at least, they don't quite cooperate > with high DPI displays.) There are support for high resolutions displays at least on OS X - maybe the situation is different on Linux?