Hacker News new | past | comments | ask | show | jobs | submit login

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.



In 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.)


I 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-mu...)

A runtime multiple dispatch stub is available as a lib, though (https://docs.racket-lang.org/multimethod/index.html)


That Racket class system isn't used much outside of the cross-platform GUI toolkit: 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/

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/

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.)


Yeah 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.


I 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._.Mi...


Mixins are pretty cool. I was playing around with 'framework's editor mixins a while ago and found it to be a pretty interesting system.


One can still do cool things with racket/gui, though: https://github.com/alex-hhh/ActivityLog2


Being inexperienced with modern Python, that leads me to ask, what's the story with GUI work on Python? Are there any good libraries?


Tk 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.


Since 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.


FWIW, ubuntu python3 does not install Tk by default.


Don't use system python. Use a virtualenv and install your own python. I would expect system python to only install what is needed.


I think aidenn0 was just replying to the claim that "it's always there".


It's not always there. Like it's not there on MSYS2.


My limited experience with PyQt3 says it isn't horrible and seems to cover most bases.


Qt3?? Qt4 came out in 2005 and Qt5 in 2013. So Qt3 and 'modern Python' don't seem to have much in common.


Thanks - I actually meant PyQt5! I don't know where PyQt3 came from... probably related to only finding info on specific functions often leading me to Qt3 docs.


I seem to recall the download is humongous?


What do you consider humongous? On my Windows Machine it's 100MB (assuming I'm counting the right directories).


Yeah that's beyond humongous, that's just ridiculous. :-) I was imagining it was more like 60MB.


On which platform/hardware is 100MB ridiculous? I was using it on my Raspberry Pi with a 32GB MicroSD card which cost ~10€ for the High Endurance version (officially supported by SanDisk for Linux/Pi) i.e. 100MB is peanuts.

Also the difference between 60MB and 100MB isn't huge, so using the word ridiculous is IMO a bit over-dramatic.


On whatever platform. Requiring a user to download and install a 100MB+ framework just to show a basic GUI is just ridiculous. Even Sublime is 33 MB and I see that as bloated, and that's including its separate copy of Python itself...


Maybe it's because PyQt is a lot more than just a basic GUI[0].

> PyQt is one of the most popular Python bindings for the Qt cross-platform C++ framework.

And why are you comparing an editor to a GUI framework? Or is there a GUI framework also called Sublime?

[0]: https://wiki.python.org/moin/PyQt


GTK works great with Python (like with most scripting languages really).


Turtle




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: