Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use gi-gtk-declarative #79

Closed
cdepillabout opened this issue Nov 13, 2018 · 2 comments
Closed

use gi-gtk-declarative #79

cdepillabout opened this issue Nov 13, 2018 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@cdepillabout
Copy link
Owner

One of the most annoying parts of hacking on Termonad is interacting with the haskell-gi libraries. This is no fault of the libraries in question, they are only a thin wrapper around the underlying GTK libraries.

The underlying GTK libraries are mostly IO-based and procedural. It is hard to come up with good, testable code when relying on those libraries.

It would be nice to use a library that lets us write more high-level declarative code.

One library to look into for this is gi-gtk-declarative:

https://wickstrom.tech/programming/2018/09/04/declarative-gtk-programming-with-haskell.html

https://wickstrom.tech/programming/2018/10/26/writing-a-screencast-video-editor-in-haskell.html

The goal for making this transition to gi-gtk-declarative would be to make more of the Termonad code testable.

(I guess some sort of FRP-based library might work as well, but I don't know of a good one for the haskell-gi ecosystem.)

@cdepillabout cdepillabout added enhancement New feature or request help wanted Extra attention is needed labels Nov 15, 2018
@owickstrom
Copy link

owickstrom commented Nov 15, 2018

Very cool! Ping me if you have any questions around gi-gtk-declarative, happy to help with that if I can! I don't think I have time to help with this particular implementation, but could answer questions about the library.

By the way, it aims to be complete, but some widgets are really hard to automatically make declarative. Thus, it's not a complete declarative layer over gi-gtk at the moment. As "workaround", I plan on providing building blocks for easily creating declarative wrappers around the imperative APIs (called "Custom Widgets").

Good luck!

@cdepillabout
Copy link
Owner Author

It looks like gi-gtk-declarative is not really being maintained anymore, so I'll go ahead and close this.

However, on the Haskell Discourse, there was some talk about someone else picking up development, so maybe we can reopen this in the future. I do think it is an interesting idea.

Also, here's a post on the Gnome Discourse that suggests a way to have a reactive-like development experience by just using Gnome itself: https://discourse.gnome.org/t/declarative-state-driven-views-for-gtk/9966/2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants