Subject:
[ruby-ffi] Re: Towards a 1.0 API for Ruby FFI
From:
Victor Costan
Date:
12/16/09 12:21 AM
To:
ruby-ffi

Is it feasible to make "FFI.add_sys_types" available on all platforms
if it's implemented at runtime?

I'm thinking ideally the ffi gem will come prebuilt, at least for OSX
and Windows, so users might not have Xcode / mingw / Vistual Studio.
To me, the biggest advantage of using ffi is not having to deal with
all the extension building stuff on a per-gem basis.

    Victor


On Dec 14, 8:04 pm, Ernest Prabhakar <ernest.prabha...@gmail.com>
wrote:
> Hi Evan,
>
> On Dec 14, 2009, at 3:28 PM, Evan Phoenix wrote:
>
> > My original API was slim and light, but had a number of holes. Those holes have been filled by the different implementations in different ways and thusly only the simplest of APIs are now common.
>
> > I think that it is in the best interest of FFI, if it is truly to be a cross implementation API, that all new API additions stop and we begin to formalize a 1.0 API.
>
> > This would allow us a clean, consistent target for all implementations. In addition, it would simplify what to spec.
>
> Sounds good to me.  I'm starting a new thread, as Google Groups gets gnarly about such things, and I want to be able to track this.  I'll put the spec effort on hold until we hash this out.
>
>
>
> > I don't want to turn this into design by committee, but if people do want the API to be cross implementation, some degree of coordination and agreement must be reached. Unilateral changes only destabilize the effort.
>
> > Since it appears that most of the FFI implementers are on this list, please reply to this email and indicate that you'd like to participate in the planning of the 1.0 API.
>
> > To kick off the 1.0 planning, here is the list of builtin types that I believe the 1.0 should contain:
>
> > Fundamental Types:
>
> >  Platform Independent: int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64, pointer, string, buffer
>
> >  Platform Dependent: char, uchar, int, uint, long, ulong, float, double
>
> > Composite Types:
>
> >  struct, callback
>
> > Users would have the ability to add their own aliases for structs, etc.
>
> > In addition, I believe the unix types provided by sys/types should be made available by requesting so. Perhaps calling "FFI.add_sys_types" would be fine (this as opposed to a require so that it can be calculated entirely at runtime if need be)
>
> > Thats a good place for us to start. Please comment.
>
> Nice. I'll try to capture the discussion on the wiki:
>
> http://wiki.github.com/ffi/ffi/proposal-for-standard-10-api
>
> -- Ernie P.