Hacker News new | past | comments | ask | show | jobs | submit login

Rock: PHP X11 PoC that I poked at a couple years ago (which doesn't use libx11/libxcb, but talks directly to /tmp/.X11-unix/X0)

Hard place: crowd of Wayland pitchforks thundering in the distance

Effort analysis: <negative beeping>

Itch: scratch?

Me: annoyed twitching




As you can see if you dig into my code and then look at the X protocol implementation [1], the (incomplete) pure Ruby X11 binding takes up more lines of code than the WM. I was tempted to write the code to generate it from the XML spec, but a lot of the scaffolding for the current X11 binding predated my own work and it seemed like it'd be more and more painful work to write the generator than bite the bullet and do it manually (I don't expect to/care about supporting the whole protocol anyway). So a PHP version would be totally viable, just tedious.

[1] https://github.com/vidarh/ruby-x11


If you do ever return to the idea of generating the X11 protocol code, you might find https://github.com/tonyg/xcb-shim interesting. I wrote it to simplify X11 implementation generally. I've used it just once, so far, though, to build a Squeak Smalltalk native X11 protocol implementation.


That's really useful, thank you. I have been considering massaging the Ruby version into a different structure as while the current one is fairly nice in some respects (such as providing support for both parsing and generating both "sides" of the protocol, entertaining my delusion of possible writing an X server), it also could definitely be faster and smaller...


Do get in touch if you do pick this up again, I'd be interested in collaborating or at least keeping track of how it goes; it was a bit lonely figuring out how to do X for Squeak in a vacuum :-)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: