Results 1 to 9 of 9

Thread: Wayland Gains Client/Server-Side Language Bindings

  1. #1
    Join Date
    Jan 2007
    Posts
    14,561

    Default Wayland Gains Client/Server-Side Language Bindings

    Phoronix: Wayland Gains Client/Server-Side Language Bindings

    Wayland has gained support for client and server-side programming language bindings...

    http://www.phoronix.com/vr.php?view=MTQ0MDQ

  2. #2
    Join Date
    Jan 2011
    Posts
    1,287

    Default

    I thought language bindings were almost trivially easy to achieve, since the protocol was described as a metalanguage which a scanner transformed to code, just as XCB are generated.

  3. #3
    Join Date
    Aug 2012
    Location
    Pennsylvania, United States
    Posts
    1,875

    Default

    Quote Originally Posted by mrugiero View Post
    I thought language bindings were almost trivially easy to achieve, since the protocol was described as a metalanguage which a scanner transformed to code, just as XCB are generated.
    There's still the language barrier. Wayland is written in C, if you want to interact with Wayland in say... Javascript. There's gotta be a way to do it.

  4. #4
    Join Date
    Jan 2011
    Posts
    1,287

    Default

    Quote Originally Posted by Ericg View Post
    There's still the language barrier. Wayland is written in C, if you want to interact with Wayland in say... Javascript. There's gotta be a way to do it.
    If I understand it correctly, Wayland is not written in C, but in XML. What is written in C, using C bindings for the protocol (generated with the use of a scanner on the XML defined protocol), is Weston, and any C based compositor. All the other bindings, if I understood correctly, should be made by running different scanners on the same definitions.

  5. #5
    Join Date
    Feb 2012
    Location
    Kingston, Jamaica
    Posts
    300

    Default

    Quote Originally Posted by mrugiero View Post
    If I understand it correctly, Wayland is not written in C, but in XML. What is written in C, using C bindings for the protocol (generated with the use of a scanner on the XML defined protocol), is Weston, and any C based compositor. All the other bindings, if I understood correctly, should be made by running different scanners on the same definitions.
    There are wayland client, server and util libraries written in C.

  6. #6
    Join Date
    Aug 2012
    Location
    Pennsylvania, United States
    Posts
    1,875

    Default

    Quote Originally Posted by mrugiero View Post
    If I understand it correctly, Wayland is not written in C, but in XML. What is written in C, using C bindings for the protocol (generated with the use of a scanner on the XML defined protocol), is Weston, and any C based compositor. All the other bindings, if I understood correctly, should be made by running different scanners on the same definitions.
    "physical" protocol, yes, xml. But as jayrulez points out: there's more than JUST the protocol to deal with.

    For example, this is the protocol: http://cgit.freedesktop.org/wayland/...b394fe90945a12

    Thats written in xml, yes. But the server and client libraries and everything else that I know of, is all written in C.

  7. #7
    Join Date
    Apr 2010
    Location
    Oslo
    Posts
    50

    Default

    Wrapping the libraries allows to make use of the existing C implementation of the protocol. Without that, one would have to write an independent implementation, potentially for each target language.
    An advantage of that is that it may be possible to make it pure Python/Javascript/whatnot.

  8. #8
    Join Date
    Jan 2011
    Posts
    1,287

    Default

    Quote Originally Posted by Ericg View Post
    "physical" protocol, yes, xml. But as jayrulez points out: there's more than JUST the protocol to deal with.

    For example, this is the protocol: http://cgit.freedesktop.org/wayland/...b394fe90945a12

    Thats written in xml, yes. But the server and client libraries and everything else that I know of, is all written in C.
    But still, I understand bindings as interfaces to use the same libraries within other languages, and the definition in XML defines the interfaces (in fact, in the same link you pasted you can see how it declares all of the parameters for the functions, along with their data types).

  9. #9
    Join Date
    Aug 2011
    Posts
    515

    Default

    Quote Originally Posted by mrugiero View Post
    I thought language bindings were almost trivially easy to achieve, since the protocol was described as a metalanguage which a scanner transformed to code, just as XCB are generated.
    In theory, you are correct. Anyone should be able to write a "scanner" that generates an IPC layer adhering to the wayland xml spec, and this has come up on the list too around the time Ekstrand started the work
    on his Java bindings. However, the way data types are concretely marshalled into the wire (eg. endianess) is not defined in the xml, and at the end Hogsberg just said "don't do that, just wrap the C libraries please".
    So in the end. the scanner generated c libs are de facto part of wayland after all.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •