# Ruby and (digitalmars) D in combination via RubyInline?

**URL:** <https://www.ruby-forum.com/t/ruby-and-digitalmars-d-in-combination-via-rubyinline/116704>\
**Category:** Ruby\
**Created:** [October 8, 2007, 9:31pm UTC](https://www.ruby-forum.com/t/ruby-and-digitalmars-d-in-combination-via-rubyinline/116704 "2007-10-08T21:31:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pure](https://www.ruby-forum.com/u/pure)\
**Post date:** [October 8, 2007, 9:31pm UTC](https://www.ruby-forum.com/t/ruby-and-digitalmars-d-in-combination-via-rubyinline/116704/1 "2007-10-08T21:31:18Z")

</div>

Hi,

has anybody tried to embed some D [1] code in Ruby via RubyInline [2]?  
Or other approaches to combine D and Ruby? As RubyInline supports  
compiler plugins, this might be possible to do. And it might be a little  
bit more fun than using C… 😉

Cheers,

Steph.

[1] [D Runtime Library](http://www.digitalmars.com/d/)  
[2] [rubyinline | software projects | by ryan davis](http://www.zenspider.com/ZSS/Products/RubyInline/)

---

<div class="post-metadata">

**Author:** ![pure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pure](https://www.ruby-forum.com/u/pure)\
**Post date:** [October 8, 2007, 9:42pm UTC](https://www.ruby-forum.com/t/ruby-and-digitalmars-d-in-combination-via-rubyinline/116704/2 "2007-10-08T21:42:28Z")

</div>

Hi,

> […] Or other approaches to combine D and Ruby? […]

Attached my work on marrying D and Ruby from like a year back.  
It works, it’s kind of low level though, there could be better  
bindings.

Kashia

---

<div class="post-metadata">

**Author:** ![pure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pure](https://www.ruby-forum.com/u/pure)\
**Post date:** [October 9, 2007, 1:13am UTC](https://www.ruby-forum.com/t/ruby-and-digitalmars-d-in-combination-via-rubyinline/116704/3 "2007-10-09T01:13:46Z")

</div>

On Oct 8, 2007, at 12:41 , Kashia B. wrote:

> Hi,
> 
> > […] Or other approaches to combine D and Ruby? […]
> 
> Attached my work on marrying D and Ruby from like a year back.  
> It works, it’s kind of low level though, there could be better  
> bindings.

Correct me if I’m wrong, but that looks like a copy/paste of the  
regular ruby headers with appropriate prefix code for D, yes? If so,  
and if actually needed for basic functionality, I don’t really want  
to wrap this up (and more importantly, maintain it) for inline.

If there is some more maintainable way, I’d be intrigued.

---

<div class="post-metadata">

**Author:** ![pure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pure](https://www.ruby-forum.com/u/pure)\
**Post date:** [October 10, 2007, 3:14pm UTC](https://www.ruby-forum.com/t/ruby-and-digitalmars-d-in-combination-via-rubyinline/116704/4 "2007-10-10T15:14:51Z")

</div>

Hi,

> Correct me if I’m wrong, but that looks like a copy/paste of the regular  
> ruby headers with appropriate prefix code for D, yes? If so, and if  
> actually needed for basic functionality, I don’t really want to wrap  
> this up (and more importantly, maintain it) for inline.

yes, essentially it is adapting the Ruby headers for D, making the C  
symbols/constants accessable to D.

> If there is some more maintainable way, I’d be intrigued.

Like I said, it’s kind of low level. There were C parsers to do that  
translation automatically, but weren’t very good at it (at least when  
I did my wrapper).

A better way would be to build something along the lines of:

- [The D/Objective-C Bridge – Michel Fortin](http://michelf.com/weblog/2007/d-objc-bridge/)

or respectively the ruby cocoa stuff.

Have a nice day,

Kashia
