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

Open
cdepillabout opened this Issue Nov 13, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@cdepillabout
Owner

cdepillabout commented Nov 13, 2018

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.)

@owickstrom

This comment has been minimized.

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment