Live data from Hacker News

Plwm – An X11 window manager written in Prolog

github.com

31–40 of 77 posts

Re: Plwm – An X11 window manager written in Prolog

#31
post #29

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.

What? Wayland is a protocol. Not an API.

The OP wants to decouple the compositor from the window manager and have them talk over a protocol. Totally doable, but not with the current Wayland protocol or (AFAIK) any proposed extension. (Although I guess the shell protocol has the start of something like this?)

Re: Plwm – An X11 window manager written in Prolog

#32

Earlier quoted context omitted.

I wish more things were protocols instead of APIs.

Could you explain the difference?

A protocol defines a set of primitives and their interactions, along with prescriptions where necessary, but is otherwise pretty loose generally. Especially in a Postels law world. APIs tend to be highly prescriptive with a highly specific interface and a lot of black box.

Think of the difference between an IETF RFC on say SMTP vs an email API - the RFC describes how clients and servers for mail routing interact through an almost dialog, while a typical email API has highly structured interfaces. Another wat to cut it is an API can be tested as it has inputs and return values dependent on those, while a protocol you can generally only assert compliance with the specification of the protocol.

People often assert protocols have something to so with RPC of some sort but that’s not true. Many language support protocols, which can be very similar to interfaces, but don’t have anything to do with OOP, etc. In language protocols it’s slightly different than network/IPC protocols but the intent is similar.

Re: Plwm – An X11 window manager written in Prolog

#33
post #24

Looked at the source, it’s so compact, wow.

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!

Window management and constraints in general are a perfect fit for logic programming.

Re: Plwm – An X11 window manager written in Prolog

#34
post #29

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.

What? Wayland is a protocol. Not an API.

I mean a higher level, window-manager specific protocol. Skipping all the lower level controls.

Re: Plwm – An X11 window manager written in Prolog

#35
post #24

Earlier quoted context omitted.

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!

Window management and constraints in general are a perfect fit for logic programming.

for x11, there was one written in scheme and used a proper constraint-solver for layout etc.

Re: Plwm – An X11 window manager written in Prolog

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

Re: Plwm – An X11 window manager written in Prolog

#38

Earlier quoted context omitted.

Could you explain the difference?

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.

Re: Plwm – An X11 window manager written in Prolog

#40

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.

Tags 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.
Post reply on HN