# Foo.h -\> foo.rb

**URL:** <https://www.ruby-forum.com/t/foo-h-foo-rb/53306>\
**Category:** Ruby\
**Created:** [February 1, 2006, 12:15am UTC](https://www.ruby-forum.com/t/foo-h-foo-rb/53306 "2006-02-01T00:15:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 1, 2006, 12:15am UTC](https://www.ruby-forum.com/t/foo-h-foo-rb/53306/1 "2006-02-01T00:15:43Z")

</div>

anyone out there written a parser that makes ruby dl bindings for \*.h  
files?  
seems like such a beast would exist.

regards.

-a

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 1, 2006, 2:55am UTC](https://www.ruby-forum.com/t/foo-h-foo-rb/53306/2 "2006-02-01T02:55:30Z")

</div>

On Wed, 2006-02-01 at 08:14 +0900, removed\_email\_address@domain.invalid wrote:

> anyone out there written a parser that makes ruby dl bindings for \*.h files?  
> seems like such a beast would exist.

Well, you’d need more than just a parser, since you’d often have to pick  
up on typedefs and other type information.

I wonder whether writing an alternate swig backend or something might  
work.

-mental

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 1, 2006, 3:01am UTC](https://www.ruby-forum.com/t/foo-h-foo-rb/53306/3 "2006-02-01T03:01:32Z")

</div>

On Wed, 1 Feb 2006, MenTaLguY wrote:

> On Wed, 2006-02-01 at 08:14 +0900, removed\_email\_address@domain.invalid wrote:
> 
> > anyone out there written a parser that makes ruby dl bindings for \*.h files?  
> > seems like such a beast would exist.
> 
> Well, you’d need more than just a parser, since you’d often have to pick  
> up on typedefs and other type information.
> 
> I wonder whether writing an alternate swig backend or something might  
> work.

that’s about what i was thinking too. the cool thing about it would be  
that  
you’d end up with ‘portable’ ruby extension requiring no compilation…  
probably too big for me - i’m waiting for ryan davis to jump on 😉

-a

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 1, 2006, 7:49pm UTC](https://www.ruby-forum.com/t/foo-h-foo-rb/53306/4 "2006-02-01T19:49:35Z")

</div>

On Jan 31, 2006, at 5:59 PM, removed\_email\_address@domain.invalid wrote:

> > I wonder whether writing an alternate swig backend or something might  
> > work.
> 
> that’s about what i was thinking too. the cool thing about it  
> would be that  
> you’d end up with ‘portable’ ruby extension requiring no  
> compilation…  
> probably too big for me - i’m waiting for ryan davis to jump on 😉

I tried to use DL to wrap libc for MetaRuby but found that it is  
lacking necessary features to make it 100% useable (like 64 bit  
integers for stat(2)). Switching to DL2 adds an unfamiliar  
dependency whereas RubyInline is a familiar dependency.

–  
Eric H. - removed\_email\_address@domain.invalid - [http://segment7.net](http://segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)
