Protocol (scanner) proposals

Pekka Paalanen ppaalanen at gmail.com
Wed Jul 30 11:27:32 PDT 2014


On Wed, 30 Jul 2014 15:00:55 +0200
Auke Booij <auke at tulcod.com> wrote:

> I am in the process of writing bindings to Wayland for Haskell, and
> have run into some issues which I think you may be interested in
> solving.

...

> 2. The current wayland-scanner produces a huge amount of "static
> inline" functions. In C, this doesn't make a big impact, but the fact
> that these functions are all static means that one cannot link to
> them, so that anyone writing language bindings is forced to write C
> code calling all the individual functions - whereas linkable functions
> often don't even require a single line of C code.

Actually no. Binding writers are expected to write their own code
generator for their language, like wayland-scanner is for C. You
are expected to not use the static inline generated C functions.

All the static inline functions are not part of the... how was it
defined, ABI? Inline functions obviously get compiled into the app,
not exported by the library.

Instead the functions actually exported by the library are the ABI.

http://wayland.freedesktop.org/docs/html/sect-Protocol-Code-Generation.html

> Now, I assume that the "inline" is to help with efficiency, and that
> the functions are "static" because you guys somewhat arbitrarily put
> these definitions in the header files.

No, it's an ABI thing, see above.

> Now, I don't know the impact of this change on the ABI, and on
> applications linked to the current setup. Presumably stuff linked
> against the current wayland won't work anymore, because they link to
> wl_proxy_marshal which has now been made "static inline". But
> recompilation should fix it, since the functions still exist with the
> same names. I think.

We cannot break existing binaries. Requiring recompilation is a
no-go.

> 3. I am working on a document listing the things I found nontrivial or
> unexpected
> https://github.com/tulcod/haskell-wayland/blob/master/NOTES.md
> You may wish to look at it, to possibly incorporate in your documentation?

I would love to see documentation patches!

In fact, you inspired me to draw a picture, attached. Maybe that
could be integrated in the Wayland docs somehow.

There's a practical issue for reviewing documentation patches,
though. Publican seems to be tricky to install, so not many people
bother, and it is used to generate the docs. But at least the facts
can always be reviewed.

> 4. I think that you should place the protocol files that are currently
> in the weston repository (weston/protocol/*.xml) to the wayland
> repository, since it may be of interest to other implementations of
> compositors as well (and then having to depend on weston would be a
> bit awkward).

Only when those protocols a) become stable, and b) are actually
intended to be public and not specific to Weston.

I think the latest move was wl_subcompositor.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: protocol-objects.svg
Type: image/svg+xml
Size: 19443 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20140730/c0c25bb5/attachment-0001.svg>


More information about the wayland-devel mailing list