Haskell wlroots bindings

waymonad-scanner looks like it’s still able to make server bindings, but it never got around to implementing client bindings. I threw xdg-shell.xml at it just to see and it generated interfaces, resource dispatchers, and client messaging glue code (i.e. wl_resource_post_array calls). I’m not super familiar with what’s needed on the server side, so hard to say if it’s complete.

It does look like @Abab9579 tried reviving waymonad-scanner a few months ago. Did anything useful come from that?

Given that haskell-wayland looks like it works enough for wayland.xml, I’m not super convinced it’s worth implementing a better scanner implementation at the moment. You should only really need it for additional protocols you need models for, e.g. some custom protocol in wlroots you want to use. Most of the real wlroots functions would still need manual bindings.

waymonad-scanner notes:

  • It depends on haskell-wayland, which I don’t think it needs to?
  • It also depends on hsroots which it definitely doesn’t need to.
  • object marshaling is kind of weird. It expects you to pass in the marshaling functions for object args, otherwise it just defaults to WlResource (opaque type)
  • Generated code does utilize StablePtr, which necessitates back and forth coercion to Ptr if you try to actually do anything with the functions
2 Likes