Live data from Hacker News

Plwm – An X11 window manager written in Prolog

github.com

51–60 of 77 posts

Re: Plwm – An X11 window manager written in Prolog

#52
post #23

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.

This is one of the best resources for “real” Prolog: https://www.metalevel.at/prolog His YouTube videos are also incredibly good.

I have to concur. Markus Triska is best Prolog resource out there nowaday. Extremely well explained, using modern notations etc.

Re: Plwm – An X11 window manager written in Prolog

#53
post #38

Earlier quoted context omitted.

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 wi…

> 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.

Not 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

Was a lot easier to understand for me than, say, dwm.

Re: Plwm – An X11 window manager written in Prolog

#55
post #38

Earlier quoted context omitted.

> 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.

Not 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 Was a lot easier to understand for me than, say, dwm.

[deleted]

Re: Plwm – An X11 window manager written in Prolog

#57
post #38

Earlier quoted context omitted.

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 wi…

> 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.

I created my own X11 window manager [1] at the start of this year in around 800 lines of C.

I had been using dwm (4000 lines of C) for many years and wished to write my own for a long time, but what made me take the leap was really steveWM [2] and TinyWM [3] which are both super small.

[1] - https://github.com/ChanderG/cellwm [2] - https://github.com/stodd1031/steveWM [3] - https://github.com/mackstann/tinywm

Re: Plwm – An X11 window manager written in Prolog

#58
post #38

Earlier quoted context omitted.

> 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.

I created my own X11 window manager [1] at the start of this year in around 800 lines of C. I had been using dwm (4000 lines of C) for many years and wished to write my own for a long time, but what made me take the leap was really steveWM [2] and TinyWM [3] which are both super small. [1] - https://github.com/ChanderG/cellwm [2] - https://github.com/stodd1031/steveWM [3] - https://github.com/mackstann/tinywm

TinyWM was the starting-point for my wm in Ruby as well. It really drives home just how little you need to get started.

Re: Plwm – An X11 window manager written in Prolog

#59
this 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.

Post reply on HN