Language bindings for wayland

Kristian Høgsberg krh at
Mon Nov 22 07:02:54 PST 2010

On Sat, Nov 20, 2010 at 5:12 PM, Carl-Philip Haensch
<Carl-Philip.Haensch at> wrote:
> Hi,
> i'm planning to write languate bindings for freepascal (fpc) but there are
> some things that make it hard for me to port (=blocks automatic header
> generation)
>  - inline functions and their implementation in the header file
>  - "struct foo *" as declaration in return types
>  - #define inline function magic

Ok, first of all, I think it's a little too early to do bindings for
wayland, and taking a step back, I'm not event sure that it makes
sense.  The wayland libraries are first a foremost a platform for
toolkits like gtk+, qt, clutter, fltk, and so on.  So the way to write
a wayland client in your favorite non-C language would be to port the
toolkit you intend to use, and then just use the language bindings for
that toolkit.

Of course, in case your toolkit is written in something else that C or
if your application doesn't use a toolkit, you'll need wayland
bindings for that language (as well as EGL bindings, libxkbcommon
bindings etc).  For the wayland part, you're better off binding at a
lower level than the C API level.  As a minimum you'll want to
generate language specific stubs from the protocol xml directly
instead of binding the generated C code, but for an interpreted
language, you definitely don't want libffi in there to call a C
functions which then calls into the interpreted language (I understand
this probably doesn't apply to fpc).


More information about the wayland-devel mailing list