GithubHelp home page GithubHelp logo

yardarm's Introduction

Yardarm

The Yardarm is a type introspection library for C. It gives you enough rope to provide descriptions of the C types used in your program, which you can access during compilation or at runtime. Think of it as a C version of C++'s RTTI or Java's reflection API.

Why?

A common complaint about C is the amount of boilerplate code that you have to write. Often, this boilerplate is completely uninteresting "turn the crank" code that only depends on the stucture of one of your C types. One way around this problem is to use code generation to automatically produce all of the annoying boilerplate from a nicer, more conside description of the type.

Another option is to provide a single, generic implementation of the boilerplate code, that would work with any type. To do this, the generic implementation would need information, at runtime, about the types involved. All the usual benefits of type introspection, but for C.

Isn't this just libffi?

This might sound awfully familiar to libffi. After all, libffi provides ffi_type, which is used to describe the types of values passed around by functions. However, ffi_type does not contain all of the information we might need to know about a C type. Since libffi is focused on calling conventions and ABIs, ffi_type focuses on just the information needed to successfully use a value of that type as a parameter or result of a function call.

Yardarm and libffi type descriptors are orthogonal. In fact, one of the (more immediate) plans for Yardarm is to allow you to automatically generate ffi_type descriptors from a Yardarm type descriptor.

How?

Coming soon. The API is in flux; check back in a few days.

yardarm's People

Watchers

 avatar  avatar

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.