6 ms·
While I'm impressed with racket on the whole, I can't quite agree to be impressed by the GUI bits. They're extremely limited, and once I got away from "how do I
by regularfry 7y ago
While I'm impressed with racket on the whole, I can't quite agree to be impressed by the GUI bits. They're extremely limited, and once I got away from "how do I put a button on the screen" I didn't find the underlying implementation lent itself to being extended. In particular the drag and drop system only goes as far as file drops, and I quite quickly hit a brick wall trying to add anything more interesting.
- darkpuma 7y agoIn principle you can get pretty far with racket/gui despite it's limited amenities because you can roll your own widgets with canvas. However I too ran into wanting to create a drag source (not merely target) for files and couldn't find a reasonable way. To be honest though, I think the biggest missed opportunity in racket is the single dispatch object system, used particularly by racket/gui. For some reason the core racket folks weren't smitten with CLOS and didn't go the Guile route of implementing something similar to it (Guile has GOOPS, which is related to Tiny-CLOS.)
- rscho 7y agoI suspect the main authors of the language did not implement multiple dispatch on purpose, as it leads to unsafe edge cases (see https://lexi-lambda.github.io/blog/2016/02/18/simple-safe-multimethods-in-racket/ https://lexi-lambda.github.io/blog/2016/02/18/simple-safe-mu...) A runtime multiple dispatch stub is available as a lib, though (https://docs.racket-lang.org/multimethod/index.html https://docs.racket-lang.org/multimethod/index.html)
- neilv 7y agoThat Racket class system isn't used much outside of the cross-platform GUI toolkit: https://news.ycombinator.com/item?id=20321095 https://news.ycombinator.com/item?id=20321095 The Racket class system has seemed fine to me for the GUI tookit (except for me not liking typing `send`). But if you find a limitation for that purpose, please post about it on the `racket-users` email list. The core developers are there. https://groups.google.com/forum/#!forum/racket-users/ https://groups.google.com/forum/#!forum/racket-users/ FWIW, Racket (when it was still PLT Scheme) got a tiny-CLOS-alike around the time that Guile got GOOPS: Eli Barzilay made Swindle: https://docs.racket-lang.org/swindle/ https://docs.racket-lang.org/swindle/ CLOS is neat, and I'd be interested to see someone make a CLOS (maybe including a MOP?) for Racket, atop the modern Racket `struct` and other features. (If you tune it, try tuning for the tentatively forthcoming Chez backend to Racket, rather than for the current JIT. IIRC, Swindle was written before the JIT.)
- darkpuma 7y agoYeah I don't use racket's class system on a regular basis for anything other than racket/gui. It's not so much that I find myself unable to do things with it; it's just that it's one of the cases where racket seems dull and uninspired. If it weren't single dispatch, I don't think I (and others) would avoid it so much. No offense to the design team intended, I'm sure they had different priorities for which single dispatch made sense.
- neilv 7y agoI agree. Almost all class systems now are rehashes of things that are useful and were once very exciting, but now you've seen them in tens of languages. When you encounter yet another one, learning it is usually a matter of seeing which set of semantics it provides (probably all of which you've seen before), and the exact way they do it. Though one nice feature they included with Racket's `class` library, which was unusual (but not new) at the time, is mixins: https://docs.racket-lang.org/guide/classes.html#%28part._.Mixins%29 https://docs.racket-lang.org/guide/classes.html#%28part._.Mi...
- darkpuma 7y agoMixins are pretty cool. I was playing around with 'framework's editor mixins a while ago and found it to be a pretty interesting system.
- copperx 7y agoBeing inexperienced with modern Python, that leads me to ask, what's the story with GUI work on Python? Are there any good libraries?
- darkpuma 7y agoTk from python is pretty damn convenient, being as it's always there. Not the most modern toolkit for sure, but always being there is a pretty compelling feature for some GUI projects.
- aidenn0 7y agoFWIW, ubuntu python3 does not install Tk by default.
- deckiedan 7y agoSince it came up, Tkinter's drag and drop story is pretty grim too. I've used Tkinter with python to make a whole bunch of quick utilities (sync tools for non-techies, XML editing stuff for file applications which lack needed tools, etc.) and think it's very under appreciated.
- mehrdadn 7y agoIt's not always there. Like it's not there on MSYS2.
- glenneroo 7y ago
- rscho 7y agoOne can still do cool things with racket/gui, though: https://github.com/alex-hhh/ActivityLog2 https://github.com/alex-hhh/ActivityLog2