News for hackers. Stuff that matters.
Re:Racket Is an Acceptable Python by regularfry on Thursday July 11, 2019 @03:19PM (#20414650)
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.
Re:Racket Is an Acceptable Python by darkpuma on Thursday July 11, 2019 @03:38PM (#20414940)
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.)

Re:Racket Is an Acceptable Python by rscho on Thursday July 11, 2019 @05:15PM (#20415919)
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)

Re:Racket Is an Acceptable Python by neilv on Thursday July 11, 2019 @05:24PM (#20415988)
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.)

Re:Racket Is an Acceptable Python by darkpuma on Thursday July 11, 2019 @07:03PM (#20416696)
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.

Re:Racket Is an Acceptable Python by neilv on Thursday July 11, 2019 @08:03PM (#20417019)
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...

Re:Racket Is an Acceptable Python by darkpuma on Thursday July 11, 2019 @08:15PM (#20417070)
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.
Re:Racket Is an Acceptable Python by rscho on Thursday July 11, 2019 @05:17PM (#20415936)
One can still do cool things with racket/gui, though: https://github.com/alex-hhh/ActivityLog2
Re:Racket Is an Acceptable Python by copperx on Thursday July 11, 2019 @03:57PM (#20415182)
Being inexperienced with modern Python, that leads me to ask, what's the story with GUI work on Python? Are there any good libraries?
Re:Racket Is an Acceptable Python by darkpuma on Thursday July 11, 2019 @04:09PM (#20415282)
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.
Re:Racket Is an Acceptable Python by deckiedan on Thursday July 11, 2019 @05:25PM (#20415997)
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.

Re:Racket Is an Acceptable Python by aidenn0 on Thursday July 11, 2019 @04:23PM (#20415418)
FWIW, ubuntu python3 does not install Tk by default.
Re:Racket Is an Acceptable Python by usbseeker on Thursday July 11, 2019 @04:31PM (#20415513)
Don't use system python. Use a virtualenv and install your own python. I would expect system python to only install what is needed.
Re:Racket Is an Acceptable Python by JadeNB on Thursday July 11, 2019 @05:17PM (#20415933)
I think aidenn0 was just replying to the claim that "it's always there".
Re:Racket Is an Acceptable Python by mehrdadn on Thursday July 11, 2019 @06:06PM (#20416333)
It's not always there. Like it's not there on MSYS2.
Re:Racket Is an Acceptable Python by glenneroo on Thursday July 11, 2019 @04:09PM (#20415285)
My limited experience with PyQt3 says it isn't horrible and seems to cover most bases.
Re:Racket Is an Acceptable Python by jononor on Thursday July 11, 2019 @06:12PM (#20416383)
Qt3?? Qt4 came out in 2005 and Qt5 in 2013. So Qt3 and 'modern Python' don't seem to have much in common.
Re:Racket Is an Acceptable Python by glenneroo on Thursday July 11, 2019 @08:23PM (#20417101)
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.
Re:Racket Is an Acceptable Python by mehrdadn on Thursday July 11, 2019 @06:05PM (#20416325)
I seem to recall the download is humongous?
Re:Racket Is an Acceptable Python by glenneroo on Thursday July 11, 2019 @08:31PM (#20417137)
What do you consider humongous? On my Windows Machine it's 100MB (assuming I'm counting the right directories).
Re:Racket Is an Acceptable Python by mehrdadn on Friday July 12, 2019 @12:32AM (#20418189)
Yeah that's beyond humongous, that's just ridiculous. :-) I was imagining it was more like 60MB.
Re:Racket Is an Acceptable Python by glenneroo on Friday July 12, 2019 @07:27AM (#20419868)
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.

Re:Racket Is an Acceptable Python by mehrdadn on Friday July 12, 2019 @07:42AM (#20419935)
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...
Re:Racket Is an Acceptable Python by glenneroo on Friday July 12, 2019 @02:44PM (#20423249)
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

Re:Racket Is an Acceptable Python by floatboth on Thursday July 11, 2019 @07:21PM (#20416796)
GTK works great with Python (like with most scripting languages really).
Re:Racket Is an Acceptable Python by Madzen1 on Friday July 12, 2019 @12:58AM (#20418303)
Turtle