[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby and (digitalmars) D in combination via RubyInline?

Stephan Mueller

10/8/2007 7:31:00 PM

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] http://www.digitalm...
[2] http://www.zenspider.com/ZSS/Products/R...

2 Answers

Ryan Davis

10/8/2007 11:13:00 PM

0


On Oct 8, 2007, at 12:41 , Kashia Buch 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.


Kashia Buch

10/10/2007 1:12:00 PM

0

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:

* http://michelf.com/weblog/2007/d-ob...

or respectively the ruby cocoa stuff.

Have a nice day,

Kashia

--
Using Opera's revolutionary e-mail client: http://www.opera...