[HN Gopher] Plwm - An X11 window manager written in Prolog
       ___________________________________________________________________
        
       Plwm - An X11 window manager written in Prolog
        
       Author : jedeusus
       Score  : 118 points
       Date   : 2025-05-25 17:41 UTC (5 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | leephillips wrote:
       | Very nice. If you're used to dwm this should be natural. Unless
       | you use dwm's tags as more than workspaces, which I do. The
       | author does not, so he implemented workspaces instead of tags. So
       | this can not replace dwm for me.
        
       | B1FF_PSUVM wrote:
       | Why am I reminded of the all-Erlang HN first page?
        
         | pona-a wrote:
         | Fun fact: the first version of Erlang interpreter was written
         | in Prolog.
        
       | YeGoblynQueenne wrote:
       | Oh wow, I gotta try this.
       | 
       | Lots of documentation! Awesome!
        
       | rclkrtrzckr wrote:
       | Isn't ".pl" actually used for perl?
       | 
       | Well, there might be a Prolog interpreter written in (a) perl
       | (regex) ...
        
         | ajdude wrote:
         | Prolog was using .pl for a bit over a decade before Perl
         | existed.
        
         | jimjimjim wrote:
         | Prolog is a older than Perl and there doesn't need to be any
         | exclusive claim on file extensions.
        
         | tikhonj wrote:
         | It's used for both which consistently confuses logic that guess
         | programming language purely based on file extensions.
        
       | gatane wrote:
       | Time to do one in Scheme, I guess.
        
         | pona-a wrote:
         | Here's one in Guile Scheme.
         | 
         | https://wingolog.org/archives/2008/07/31/introducing-griddy
        
         | tmtvl wrote:
         | Already exists: https://github.com/mwitmer/guile-wm
         | 
         | There might also be ones in other Schemes, but as FFI hasn't
         | been standardised across Schemes yet I doubt there's an
         | implementation-agnostic one.
        
         | mhd wrote:
         | Done a while ago: https://en.wikipedia.org/wiki/Scwm
         | 
         | There was also "GWM", based on its own lisp dialect, "WOOL",
         | which was around from at least the early 90s.
         | 
         | On the more popular side, you had sawfish (using an elisp-
         | alike, IIRC) and stumpwm (Common Lisp).
        
         | DonHopkins wrote:
         | Here's an X11 window manager, with pie menus and tabbed
         | windows, entirely written in object oriented NeWS PostScript,
         | from around 1991:
         | 
         | https://donhopkins.com/home/archive/NeWS/owm.ps.txt
         | 
         | And some design notes and emails on that NeWS based window
         | manager for X11 windows:
         | 
         | https://donhopkins.com/home/archive/NeWS/i39l.txt
         | 
         | It incorporated NeWS tabbed windows written in PostScript,
         | which could wrap around X11 windows (and frame NeWS windows too
         | of course):
         | 
         | https://donhopkins.com/home/archive/NeWS/win/tab.ps
         | 
         | And NeWS pie menus written in PostScript, which you could pop
         | up on tabbed window frames and manage X11 windows (and use in
         | NeWS apps too of course):
         | 
         | https://donhopkins.com/home/archive/NeWS/win/pie.ps
         | 
         | There was also a virtual large scrolling desktop, and virtual
         | multi-screen "rooms", both purely written in PostScript, which
         | all plugged together with the tabbed windows and pie menus and
         | X window manager seamlessly. They were all independent of each
         | other and could be used separately, but worked together
         | synergistically. Take that, ICCCM! ;)
         | 
         | Also here's a (pre-ICCCM, pre-X11) X10 window manager with pie
         | menus, written in C and scripted in Forth, from around 1986:
         | 
         | https://donhopkins.com/home/archive/piemenu/uwm/fuwm-main.f
         | 
         | And some of my thoughts on X-Windows and ICCCM window
         | management in general:
         | 
         | https://donhopkins.medium.com/the-x-windows-disaster-128d398...
         | 
         | >In summary, ICCCM is a technological disaster: a toxic waste
         | dump of broken protocols, backward compatibility nightmares,
         | complex nonsolutions to obsolete nonproblems, a twisted mass of
         | scabs and scar tissue intended to cover up the moral and
         | intellectual depravity of the industry's standard naked
         | emperor.
         | 
         | >Using these toolkits is like trying to make a bookshelf out of
         | mashed potatoes." -Jamie Zawinski
        
           | agumonkey wrote:
           | First time I ever get the chance to see object
           | postcript/forth, thank you
        
         | igorhvr wrote:
         | This one is customizable in Lisp, and overall pretty neat:
         | https://sawfish.tuxfamily.org/ - I have been happily using it
         | daily for many years now. :-)
        
       | eikenberry wrote:
       | I'm hoping one day someone will write a window-manager service
       | for Wayland that replaces the compositor API with a protocol. To
       | once again enable window managers to be implemented in any
       | language, regardless of it having a Wayland/compositor library.
        
         | pyinstallwoes wrote:
         | I wish more things were protocols instead of APIs.
        
           | linux2647 wrote:
           | Could you explain the difference?
        
             | spicybright wrote:
             | I'm not the most knowledgeable, but a protocol talks to
             | another process through a specific format.
             | 
             | I personally think its more powerful than writing a new
             | process to replace and existing.
             | 
             | My favorite example is an X11 windows manager implementing
             | in about 18 lines of python.
             | 
             | Obviously there's dependencies to talk to the X server, but
             | the power of a protocol comes from any program written in
             | any la gage communicate with existing code.
        
       | smikhanov wrote:
       | Looked at the source, it's so compact, wow.
        
         | echelon wrote:
         | It looks nothing like the Prolog I've seen before.
         | 
         | I'm quite amazed the author took a declarative language meant
         | for logic and turned it on its head for managing windows as an
         | actual application.
         | 
         | Bravo!
        
       | raron wrote:
       | Does someone know a tutorial or something which explains how to
       | get from "tutorial Prolog" to "real project Prolog", because
       | that's not look anything like tutorial Prolog.
       | 
       | Prolog seems interesting, but any time I tried to do anything
       | more than toy examples on my own, I got infinite recursion,
       | unsolvable problems.
        
       ___________________________________________________________________
       (page generated 2025-05-25 23:00 UTC)