Giter Club home page Giter Club logo

Comments (3)

ebassi avatar ebassi commented on May 26, 2024

No. Emeus ships with introspection data, so Vala can use that for its own API.

from emeus.

ZanderBrown avatar ZanderBrown commented on May 26, 2024

As far as I'm aware Vala does not support using GIR directly

Why not use GObject Introspection directly?

Sometimes it can, but we generally discourage it for several reasons. Obviously, you'll no longer receive the benefits mentioned in the preceding section, but there are also several problems that occur for people attempting to consume your API in Vala.

Using a GIRs directly tends to cause people to use other GIRs directly, either on accident or because they believe there is nothing wrong with doing so, but even if your GIR doesn't require any metadata others likely will. For example, if your GIR includes Gio-2.0 and the user doesn't pass --pkg gio-2.0, the GIR for GIO will be included automatically by the compiler instead of the VAPI. GIO is one of those libraries which does require metadata, and valac will exit with an error. These issues can be circumvented by passing the appropriate flags to valac, although this can be a bit confusing for users who expect valac automatically handle dependencies for them.

GObject Introspection also allows for some things which Vala does not, which is where the real problems begin. These issues can cause errors from Vala's GIR parser (like the ones mentioned earier from GIO), resulting in your GIR being useless to valac. The classic example of this is duplicate symbols; GObject Introspection allows for methods, virtual methods, and signals with the same name but different signatures to coexist, whereas Vala does not.

In general, Vala allows for much more API to be exposed than what GObject Introspection allows for, including generics (other than the ones built into glib), variadic arguments, default values, non-GObject inheritance, and much more (the Using Metadata Files section lists many). Not distributing a VAPI can deprive Vala consumers of many extremely interesting features.

Those libraries who choose not to distribute a VAPI are likely to end up eventually shipping a GIR which causes errors for Vala, breaking working applications.

Why Distribute Bindings Upstream

from emeus.

ebassi avatar ebassi commented on May 26, 2024

Yes, it does, up to a point. Introspection annotations can be fixed.

In any case, I'm not going to ship a separate description of the API just because Vala doesn't like the standard.

from emeus.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.