API feedback for an alternate libwayland implementation tailored for ffi bindings
Pekka Paalanen
ppaalanen at gmail.com
Tue Jul 2 08:30:59 UTC 2019
On Mon, 01 Jul 2019 10:14:26 +0000
"Victor Berger" <victor.berger at m4x.org> wrote:
> Hi everyone,
>
> A few weeks ago was discussed on IRC the idea or re-using my Rust
> implementation of the Wayland protocol [1] to build an alternate
> implementation of the libwayland C API. This is an idea I'm
> interested in, and apparently at least a few other persons are
> interested as well.
>
> However, if I'm going to re-implement a libwayland with a C API, I'd
> be willing to adapt its API, to make it more friendly to FFI bindings
> (after all Rust remains the main language in which I interact with
> Wayland). Breaking backwards compatibility being naturally a
> nonstarter, my idea is to rather create a library exposing both the
> current C API and an alternate API, under a different namespace.
>
> This alternate API would be specifically targeted at languages
> bindings, and not meant to be used directly by C applications. I have
> made a draft of such an API for client-side, with detailed comments
> about the guarantees it'd provide and how it should be used on this
> gist: [2].
...
> My focus would then be to implement this new API using Rust, and then
> add the necessary glue code to implement the current C API on top of
> it, then exposing the whole thing as a drop-in alternative to
> libwayland-client.so. I leave handling the server-side API for a
> later time.
>
> I'd like to have your feedback on this tentative API before I try to
> implement it, especially from other language bindings maintainers. I
> may very well have missed some important question when designing it.
>
> [1]: https://github.com/Smithay/wayland-rs
> [2]: https://gist.github.com/vberger/417729269d15cf11c8098aff683d5c56
Hi Victor,
all I can personally say at this time is that the general idea sounds
fine to me. I have no off-hand reason to NAK the idea of adding new
APIs to libwayland to better suit more programming languages as long as
everything that already exists keeps on working at least as well as it
did.
The current C implementation of libwayland is not going away. I imagine
distributions will be choosing which implementation they ship, so it
will be up to distributions to decide when the Rust implementation is
good enough (features, quality, architecture and OS support) to take
into use. As long as there is a maintained distribution using the C
implementation, the C implementation will remain and be maintained.
I wish you success in this effort.
Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20190702/81dce0c3/attachment.sig>
More information about the wayland-devel
mailing list