News for hackers. Stuff that matters.
Re:SumatraPDF Reader by zerr on Tuesday October 24, 2023 @03:27AM (#37995787)
> The problem is that Gtk is ugly, Qt is extremely bloated and WxWidgets barely works.

Seems like the author didn't look at cross-platform toolkits since 90s.

Re:SumatraPDF Reader by pjerem on Tuesday October 24, 2023 @03:32AM (#37995818)
What changed exactly ? Gtk is still ugly on anything that is not Linux, Qt is still bloated and wxWidgets, well here I don’t know.
Re:SumatraPDF Reader by KRAKRISMOTT on Tuesday October 24, 2023 @03:34AM (#37995826)
Flutter is decent, most of the browser/Skia based UI kits are more consistent and made by people who have an appreciation for design and aesthetics. But I think Sumatra predates most, if not all of them.
Re:SumatraPDF Reader by Sakos on Tuesday October 24, 2023 @04:34AM (#37996279)
> appreciation for design and aesthetics

Sure, but not accessibility or UX design. There's more to a good UI than looking pleasant. Far more. I wish we hadn't unlearned that in the past decade, because Flutter and browser-based UI kits throw all of that out the window.

Re:SumatraPDF Reader by OvbiousError on Tuesday October 24, 2023 @03:45AM (#37995910)
What does "Qt is bloated" even mean. It's a big framework, split into separate libraries, you include only what you use. Qt is free (most parts are LGPL) and is developed by 100+ professional developers. The quality of the implementations, API and documentation is very very good.

Discarding it out of hand by "qt is bloated" just feels disingenuous to me. You can add to that the fact that qml on the desktop if finally maturing into a viable alternative for widgets, and UI development with qml is such a breath of fresh air.

Re:SumatraPDF Reader by dspillett on Tuesday October 24, 2023 @05:22AM (#37996624)
> What does "Qt is bloated" even mean.

From a user perspective I remember that being a big thing some time ago when people didn't have anything already using Qt install did an “apt install” or “yum install” on something that did and saw the small tool they were wanting was going to drag half a desktop environment in with them as dependencies. The same could likely be said for GTK in reverse, I'm not sure what their relative sizes for similar features are these days.

Some use bloated to mean the memory footprint. IIRC GTK has more of a reputation for eating RAM than Qt, but again maybe people notice a single Qt app using a lot of resource (that would be shared if running multiple apps against the same libs) when it is the only one they run.

As you suggest, just stating that “<whatever> is bloated” without reference to some details of what is meant by that, sounds a bit like someone parroting old information and/or group-think rather than having looked into it recently.

Having said that the author has a minimal dependency stance in order to try to maintain a small footprint for the app (“I avoid unnecessary abstractions.” in the section about keeping things small) so any framework that isn't little more than a cosmetic wrapper could legitimately be called more bloated than using nothing at all and talking more directly to the standard OS libs. Also in context (discussing why the product is not cross-platform and is never likely to be) this is not the only reason being given and probably not the most significant one (there may be significant selection of cross-platform issues beyond the UI framework).

The key to a lot of what is in that document is the “It’s my project and I act like it” part. All too often we forget this very important side of things, especially with one-man or small-team projects, and people comment on project decisions as if using the product gives some automatic expectation that the creator will mould it around the needs/wants of a given user or someone's idea of “the community”. For an open source project the community has the option of forking the project or offering to fund the changes they want that aren't otherwise on the creator's roadmap (though obviously the larger the project, the less practical these options may be)…

Re:SumatraPDF Reader by LinAGKar on Tuesday October 24, 2023 @05:41AM (#37996749)
Sumatra is know for being small, with the portable version currently being 15.3 MiB. QtCore and QtGui together is some 11 MiB (checking the DLLs used by KDE programs on Windows), so those alone would increase the size significantly.
Re:SumatraPDF Reader by whizzter on Tuesday October 24, 2023 @03:39AM (#37995856)
Honestly, this is a guy who uses GDI, so most of the above options will feel bloated already when looking at the source tarball sizes.

That said, has there been any fundamentally groundbreaking crossplatform classic UI toolkits released since the 90s? (IMGui is the only one that has seemed interesting but that's specialized and not a general one really)

[dead]
Re:SumatraPDF Reader by whizzter on Tuesday October 24, 2023 @03:03PM (#38003689)
I think that's the sticking point, declarative toolkits didn't mesh too well with C++(or C) projects so we have a bunch in Rust but that's not too interesting for those with existing codebases, I started on a C++ 20 prototype myself a few years back (because to make it even remotely elegant I felt that I wanted designated initializers from C++20) but it kinda turned into a huge hairball of templates to even approach something like react style jsx/tsx rendering.

I'm pretty sure that something based on IMGui could be more or less isomorphous to React style rendering, it'd be up to someone to implement it though (and it'd probably be worth it since building applications at scale you win back a lot of time by not fiddling with state manually all over the place).

Using Chromium however is explicitly not where we should want to go (it's basically a kitchen sink in itself), but we go there anyhow (me included often) because it's just so much more quick thanks to progress in dev experience in the webdev area.

Re:SumatraPDF Reader by slikrick on Wednesday October 25, 2023 @11:29AM (#38013843)
if by plethora you mean different web implementations, sure. but there has basically been less than a handful cross platform UI toolkits since GTK/QT
Re:SumatraPDF Reader by kjksf on Tuesday October 24, 2023 @06:44AM (#37997143)
(I wrote the post).

That's fair in the sense that I did not look closely at latest Gtk or Qt or WxWidgets.

That being said they certainly did not get lighter.

Last I checked Qt was over 10 MB of libraries). Sumatra is 12 MB and I'm guessing over 8 MB is fonts needed to render PDF documents.

So just Gtk or Qt code would be more than the whole app.

Latest Gtk4 does seem to look nice so maybe calling it ugly was uncalled for.

Re:SumatraPDF Reader by a1o on Tuesday October 24, 2023 @07:07AM (#37997320)
Thanks for caring about file size!
Re:SumatraPDF Reader by signaru on Tuesday October 24, 2023 @08:11AM (#37998004)
The reason I never had to install Adobe Reader for more than a decade now is that Sumatra was/is such a tiny install. Thanks!

Edit: I just checked and Acrobat Reader requires 450/900/380 MB for Win32/Win64/Mac respectively [1]. One might argue that it does more than just read PDFs. But in many cases, reading PDFs is all that I need.

[1] https://helpx.adobe.com/reader/system-requirements.html

Re:SumatraPDF Reader by aidenn0 on Tuesday October 24, 2023 @12:10PM (#38001223)
What about Tk?
Re:SumatraPDF Reader by zerr on Tuesday October 24, 2023 @05:35PM (#38005996)
If you are counting MBs at that order, then wxWidgets would be the best option. It can be statically linked easily. The size overhead is about 2.5-3 MB. It is a thin wrapper on top of native controls, so e.g. you can always get to the underlying HWND on Windows. Even for the Windows only app, I'd still pick it due to the sane API.