8 ms·
Plwm – An X11 window manager written in Prolog
- leephillips 1y agoVery 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.
- ninjin 1y agoTags are indeed a wonderful idea once it clicks, but I have to admit it took me about a year to get somewhat comfortable with how to work with them.
- B1FF_PSUVM 1y agoWhy am I reminded of the all-Erlang HN first page?
- pona-a 1y agoFun fact: the first version of Erlang interpreter was written in Prolog.
- YeGoblynQueenne 1y agoOh wow, I gotta try this. Lots of documentation! Awesome!
- rclkrtrzckr 1y agoIsn't ".pl" actually used for perl? Well, there might be a Prolog interpreter written in (a) perl (regex) ...
- ajdude 1y agoProlog was using .pl for a bit over a decade before Perl existed.
- jimjimjim 1y agoProlog is a older than Perl and there doesn't need to be any exclusive claim on file extensions.
- tikhonj 1y agoIt's used for both which consistently confuses logic that guess programming language purely based on file extensions.
- userbinator 1y agoMy first thought upon reading your comment was "it's used for Poland" ;-)
- thijsvandien 1y agoThen using .prl in stead wouldn’t have helped much…
- gatane 1y agoTime to do one in Scheme, I guess.
- tmtvl 1y agoAlready exists: https://github.com/mwitmer/guile-wm 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.
- pona-a 1y agoHere's one in Guile Scheme. https://wingolog.org/archives/2008/07/31/introducing-griddy https://wingolog.org/archives/2008/07/31/introducing-griddy
- mhd 1y agoDone a while ago: https://en.wikipedia.org/wiki/Scwm 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).
- anthk 1y agoSawfish (the oficial VM of Gnome for a while) had Lisp plugins (or was it written in Lisp too?)
- DonHopkins 1y agoHere'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 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 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 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 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 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-128d398ebd47 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
- eikenberry 1y agoI'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 1y agoI wish more things were protocols instead of APIs.
- linux2647 1y agoCould you explain the difference?
- spicybright 1y agoI'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.
- xorbax 1y ago> My favorite example is an X11 windows manager implementing in about 18 lines of python. Uh, do you happen to know where to find that project? Sounds pretty comprehensible for most people as an example.
- alpaca128 1y agoNot sure about that Python project, but years ago I found this very minimal WM in a few hundred lines of C helpful: https://github.com/dylanaraps/sowm https://github.com/dylanaraps/sowm Was a lot easier to understand for me than, say, dwm.
- reramuyc 1y ago[dead]
- smikhanov 1y agoLooked at the source, it’s so compact, wow.
- echelon 1y agoIt 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!
- Y-bar 1y agoNot just compact, but it also has lots of clearly written comments, love to see it!
- raron 1y agoDoes 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.
- anal_reactor 1y ago[flagged]
- actionfromafar 1y agoBut it sort of is maths.
- i80and 1y agoI'm curious how you figure a language whose central verbs and nouns are logic "isn't math".
- arnsholt 1y agoMany people, when they say math, mean continuous math. At work, my colleagues are almost entirely statisticians and actuaries, and I sometimes joke that my only math course at university was Calculus 1. I have of course done lots more math, but it’s all CS type stuff like logic and discrete structures like graphs and trees which is a very different world from continuous stuff.
- kqr 1y agoThese cultural differences even determine how you eat your corn: http://bentilly.blogspot.com/2010/08/analysis-vs-algebra-predicts-eating.html http://bentilly.blogspot.com/2010/08/analysis-vs-algebra-pre... (I know this is weak evidence that has been debunked by stronger studies.)
- anthk 1y agoDiscrete math it's far easier to grasp than continous curves under calculus.
- saffsffefewafew 1y ago[dead]
- bolangi 1y agoAside from the choice of language, I will be interested in what window managers are similar, or an inspiration for plwm.
- jimmaswell 1y agoI installed all the libs and compiled this on Gentoo, but all I'm getting is a mouse cursor on a black screen.
- johnisgood 1y agoThat is literally most tiling window managers. Check the keybindings. Start a terminal or something.
- jimmaswell 1y agoI did read all the keybindings (as well as the entire README.md) hoping to find a "launch" or similar command but there was nothing relevant. "Increase number of master windows" was most promising but nothing happened. The only command that responded was super+shift+q to quit. Nothing abnormal going on in the Xorg or plwm logs.
- ayrtondesozzla 1y agoYou've never used ratpoison, I see
- 5- 1y agothis looks very impressive. forgive me a stupid question as a prolog outsider: is this actually using any logical prolog features, or mostly just the 'functional' subset of prolog? on a cursory look almost all annotated predicates are either 'det' or 'semidet', and none seem to have ? argument modes, so on the surface it looks like this is mostly straight functional code. am i missing something important? to be sure, prolog has much to recommend it even as a non-logic functional language: great syntax with probably the most flexible grammar out of all non-research languages (e.g. prolog's operator definition facility makes the ilk of haskell's seem like a toy), homoiconicity, etc. but at least my expectation is perhaps for prolog code to make use more of the logical facilities.
- mbrock 1y agoI actually started hacking on a Prolog X11 WM last year, got distracted by other things but what I started with was a module to define BSP-style partitions using rational constraints, so you would be able e.g. to easily cycle between valid pane layouts.
- deleted 1y ago[deleted]
- fsadoifaoie8 1y ago[dead]
- major505 1y agoI don't know what amazes me more. The fact that someone used prolog to write a window manager, or the fact somone uses prolog at all.
- DaiPlusPlus 1y ago> or the fact somone uses prolog at all. I'll point your attention to 6 years ago: https://news.ycombinator.com/item?id=19279088 https://news.ycombinator.com/item?id=19279088 Another fun Prolog fact: Between 1996 and 2000, a Prolog program was distributed to tens of millions of users as part of Windows NT 4: https://web.archive.org/web/20040603192757/research.microsoft.com/research/dtg/davidhov/pap.htm https://web.archive.org/web/20040603192757/research.microsof... (via https://news.ycombinator.com/item?id=29528921 https://news.ycombinator.com/item?id=29528921 ) So do people use Prolog today? Given it's demonstrable that people use NT4 today, even if only for frivolous nostalgia trips or just an appreciation of _retro_-computing because if we can enjoy a mid-1990s abstract geometric screensaver today then it's no different to appreciating a 1960s Lava Lamp if you lived in the 1990s (presumably sat on the same desk and computer you're trying to install NT4 on).
- major505 1y agoprett cool to know that. Guest is something you need to be in the middle to really know about. Like cobol.
- Jerry2 1y agoAre there any WMs that are implemented in JS and CSS? Or at least allow you to use JS/CSS? I’d love to be able to use web technologies to manage and decorate windows.
- rabiescow 1y agoSome of you hold on to X11 harder than Gollum and his ring...