Announcement

Collapse
No announcement yet.

Wayland Gains Client/Server-Side Language Bindings

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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.

      Comment


      • #4
        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.

        Comment


        • #5
          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.

          Comment


          • #6
            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.

            Comment


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

              Comment


              • #8
                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).

                Comment


                • #9
                  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.

                  Comment

                  Working...
                  X