{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreica3kt36pwd3byakqc3lyi6azztxzzgeeldbrewyw7oqjsv6vcuc4",
"uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mjilaokjwwe2"
},
"path": "/t/ann-rivulet-window-manager/13921?page=2#post_25",
"publishedAt": "2026-04-14T21:33:52.000Z",
"site": "https://discourse.haskell.org",
"tags": [
"Arcan Display Server",
"low-level bindings",
"bug",
"a small snippet",
"wlhs",
"cairo",
"ymonad"
],
"textContent": "A couple of years ago, quite disgusted with what Wayland represented, and probably still represents from a “political” perspective (the fact that managing a few windows requires writing a compositor which is, after all, a display server – and what that implies for independent projects, like, for instance, xmonad) I decided to take a radical approach, and started writing bindings to the Arcan Display Server. I wrote low-level bindings to part of its shared memory interface and to almost all of the text-oriented user interface, and then I started writing a higher level API, which I never pushed, also because I started getting segfaults I was not able to debug. Assuming it was my fault, I spent almost two weeks trying to find out what the problem was, just to find out that that the ghc version I was using (9.8.x) had a bug. To discover it, though, I had to write a small snippet. Frustrated by the useless effort I eventually gave up (also because Arcan is a weird one-man show: no bug reports, uses Fossil – read Sqlite and what that implies, etc.).\n\nWhat I’m trying to say is that setting too high goals, as the history of many Wayland related Haskell projects show, is apparently going to lead to failures – I think that wlhs (the `Setup.hs` I used for my Arcan project was based on `wlhs` as I said in the `README`) is an example: dealing with FunPtr callbacks and C unions, I think, was what stopped the project.\n\nAnd I’m quite sure I wouldn’t be able to write a compositor (dealing EGL, DRM is beyond my capabilities).\n\nThen, about three weeks ago, I learned about River and I though that was a game changer: I should have trusted more the free software communities and their abilities to come up with solutions enabling independent projects to use libwayland to achieve what X11, and Xlib, made possible. But I decided to take a different approach:\n\n * first: automate the generation of bindings to libwayland, without rewriting it, that are correct and usable;\n\n * second, used them to write high level APIs which can be used to write Haskell code which doesn’t look like C (xmonad/xmobar, I think, proved this is possible). As I said, I think that my experience with Arcan showed me this was achievable.\n\n\n\n\nToday I was eventually able to print some text, using the cairo package, to a buffer (I hope to push a new example in the `hs-wayland-scanner` during the week-end). This was the last step I needed to go on with my road-map:\n\n * port the xmobar code, which I’m still using, that I wrote 20 years ago, before jao took over maintainership, to Wayland, with the hope this will give me an idea of what a high level API should look like;\n\n * then port the xmonad fork I’ve been using since 2007, using River as the compositor.\n\n\n\n\nI’m looking forward to seeing other project with higher ambitions succeed. But, given the list of failures, I’d suggest to be careful in setting too high goals… just my 2 cents.\n\nPS1: I tried to get Rivulet working but I didn’t succeed: my fault (just a missing header), but I didn’t have the time to investigate and fix the problem. I must confess, though, that I wonder if the FFI code is maintainable in the long run (see my Arcan experience)\n\nPS2: did anyone notice that right the same day Rivulet was announced, on Hackage was published ymonad ? I do not understand if this is AI slop (no foreign calls, weird code – maybe it’s just me not getting it, no explanation on how to use it, still published on Hackage, etc.) or a real project: quite amusing, though, the interest in River from Haskell coders…\n\nPS3: I’m really sorry for such a long post, but this discussion is very interesting.",
"title": "[ANN] Rivulet Window Manager"
}