Is a widget a monad? Anyway, the examples in this tutorial are another proof that Haskell is the best imperative language!
black_knight [3 hidden]5 mins ago
It really is! The IO monad is basically a better C, if you know how to wield the FFI.
seba_dos1 [3 hidden]5 mins ago
Replace `backdrop-filter` on `.backdrop::after` with `filter` on `.backdrop picture` for a free scrolling performance boost.
nh2 [3 hidden]5 mins ago
Indeed the scrolling performance is awful, makes reading it less enjoyable, especially when the topic is GUIs!
grimgrin [3 hidden]5 mins ago
desktop and mobile browsers have a reader mode icon you can click. it is useful for 1) this 2) website blocking fully loaded content with some paywall popup 3) and more!
click it for a better time
shevy-java [3 hidden]5 mins ago
Are people still using gtk?
I started to learn it back then via ruby-gtk2. It was not
the best experience but I learned several key things
pertaining to widgets and the UI. Then came gtk3; it was
in some ways worse than GTK2, but it also brought a few
improvements such as the partial CSS support. I always
miss that when I use e. g. wxwidget.
Then came GTK4 though and things changed. Tons of old
things broke or no longer worked. Simple things such as
main_window_widget.move(0, 0) for top-left positioning
(I added an alias to this, .top_left in ruby and that
worked nicely); there are work-arounds to get the old
behaviour, but this is just one example of so many more
things that were eliminated. GTK4 is a GNOMEy-toolkit
and GTK5 will be even worse since it will be wayland-only.
"Interacting" with the GNOMEy-GTK devs is a total waste
of time and I am hardly the only one who had that
experience. For GNOMEys it may be a useful platform,
but GTK no longer is a general toolkit really, despite
claims by the current GTK devs otherwise. Why would
we non-GNOMEys want to keep GTK on life support? There
really needs to be a toolkit that can work in a much
more de-centralized way. Sadly I also don't have a good
idea here, since funding is an issue and GUIs seem to
have taken a huge hit ever since the world wide web
became dominating.
gen2brain [3 hidden]5 mins ago
Well, it is what was always considered to be a default toolkit. Sure, I like Qt and prefer such apps but you got a have the GTK installed anyway. It was always difficult to have general toolkit with it when you depend on dozens of dependencies, collection of libraries, not big fat libraries like in Qt, that you can deploy.
GTK4 changed a lot though, like they do not even try anymore, deprecated font dialog because that is better done with XDG portals, but such thing does not even exist. How will that work on macOS and Windows, it cannot? Or what they did with the menus. Toolkits should be user oriented and should not have vision, it just needs to work and provide controls, events, etc., you cannot even position windows in macOS and Windows with GTK4, that is not toolkit that works for users.
I am working on the IUP fork here https://github.com/gen2brain/iup-go , one toolkit to handle them all, and I did my best for GTK4 backend, but from 14 drivers/backends I worked on, it was the worst experience and I had to fight battles with it.
GalaxyNova [3 hidden]5 mins ago
McCLIM is better
XorNot [3 hidden]5 mins ago
GTK3 has nice, conventional looking interfaces. Developing for it always felt insane, but the advent of AI has completely removed the friction so I've had Claude build me quite a few apps using it because I like the look and it's easy to navigate.
pluc [3 hidden]5 mins ago
> import GI.Awd qualified as Adw
please tell me that's a typo
jolmg [3 hidden]5 mins ago
Thought you meant the "qualified" placement. According to the Haskell Report[1], it should be:
import qualified GI.Awd as Awd
but it does seem that GHC accepts putting "qualified" before "as".
i've been writing Haskell GUIs for a few years and mostly stick to react-banana or reflex because wiring up gtk-gi signals manually gets messy fast. The Elm architecture pattern here looks clean on paper but I'm curious how you handle async events from the widget tree without ending up in callback hell. Did you end up wrapping all GI callbacks in a channel that feeds into your update loop?
freedomben [3 hidden]5 mins ago
Is Haskell in this case just binding a local HTTP port that users then hit with the browser? Or is it like a Tauri/Electron type of thing?
beanjuiceII [3 hidden]5 mins ago
bro takes 2 years to make a todo list
drnick1 [3 hidden]5 mins ago
Just keep in mind that some people like me avoid Haskell and the huge package mess it causes on Linux. Pandoc is infamous for that. Just stick to C++.
black_knight [3 hidden]5 mins ago
My Haskell experience on NixOS is wonderful!
I think it depends on your district. On some distros (looking at you arch!) I think GHCup and keeping things in /home and out of your system package manager is the better approach.
That said, I never had issues with Pandoc on any distribution. But I have struggled with Pandoc extensions, before I got NixOS (and flakes).
kccqzy [3 hidden]5 mins ago
Does your distro not statically link Haskell libraries the way it’s meant to? Installing pandoc only requires libgmp.
Vosporos [3 hidden]5 mins ago
That is entirely your distribution's fault. ArchLinux has a user-hostile packaging approach which I do not experience in Fedora.
klez [3 hidden]5 mins ago
What does Arch do in particular to cause a mess? It's been a hot minute since I last used it and surely didn't use pandoc back then.
nimih [3 hidden]5 mins ago
Haskell packages in arch are dynamically, rather than statically, linked, which pulls in a large amount of transitive dependencies (reportedly in the neighborhood of a gigabyte). The maintainer has a pretty reasonable (to my eyes) explanation[1] as to why this is the case, but admittedly if I were an arch user I'd probably find it a bit annoying.
click it for a better time
I started to learn it back then via ruby-gtk2. It was not the best experience but I learned several key things pertaining to widgets and the UI. Then came gtk3; it was in some ways worse than GTK2, but it also brought a few improvements such as the partial CSS support. I always miss that when I use e. g. wxwidget.
Then came GTK4 though and things changed. Tons of old things broke or no longer worked. Simple things such as main_window_widget.move(0, 0) for top-left positioning (I added an alias to this, .top_left in ruby and that worked nicely); there are work-arounds to get the old behaviour, but this is just one example of so many more things that were eliminated. GTK4 is a GNOMEy-toolkit and GTK5 will be even worse since it will be wayland-only.
"Interacting" with the GNOMEy-GTK devs is a total waste of time and I am hardly the only one who had that experience. For GNOMEys it may be a useful platform, but GTK no longer is a general toolkit really, despite claims by the current GTK devs otherwise. Why would we non-GNOMEys want to keep GTK on life support? There really needs to be a toolkit that can work in a much more de-centralized way. Sadly I also don't have a good idea here, since funding is an issue and GUIs seem to have taken a huge hit ever since the world wide web became dominating.
GTK4 changed a lot though, like they do not even try anymore, deprecated font dialog because that is better done with XDG portals, but such thing does not even exist. How will that work on macOS and Windows, it cannot? Or what they did with the menus. Toolkits should be user oriented and should not have vision, it just needs to work and provide controls, events, etc., you cannot even position windows in macOS and Windows with GTK4, that is not toolkit that works for users.
I am working on the IUP fork here https://github.com/gen2brain/iup-go , one toolkit to handle them all, and I did my best for GTK4 backend, but from 14 drivers/backends I worked on, it was the worst experience and I had to fight battles with it.
please tell me that's a typo
[1] https://www.haskell.org/onlinereport/haskell2010/haskellch5....
https://hackage.haskell.org/package/gi-adwaita
I think it depends on your district. On some distros (looking at you arch!) I think GHCup and keeping things in /home and out of your system package manager is the better approach.
That said, I never had issues with Pandoc on any distribution. But I have struggled with Pandoc extensions, before I got NixOS (and flakes).
[1] https://www.reddit.com/r/linux/comments/9emwtu/comment/e5qss...