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

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.




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

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

Search: