digitalmars.D - Has anybody tried calling D from Ruby?
- Atila Neves (8/8) Apr 13 2014 The best I could manage was to use the C/C++ API and have that
- Jacob Carlborg (11/18) Apr 13 2014 I have embedded Ruby in a D application. Called methods in both
- Atila Neves (4/12) Apr 14 2014 I will.
- Jacob Carlborg (5/7) Apr 14 2014 I think it was with DStep and some manual tweaks. Otherwise it was just
The best I could manage was to use the C/C++ API and have that call the linked in D code by hacking the automatically generated Makefile. But at least that worked, up to a point. Even though I linked in Phobos, it crashed when I called writeln (but core.stdc.stdio.printf was ok). Trying to use the C API directly from D didn't really work. I tried dstep on ruby.h and it threw an exception. Ah, macros... Atila
Apr 13 2014
On 2014-04-13 11:20, Atila Neves wrote:The best I could manage was to use the C/C++ API and have that call the linked in D code by hacking the automatically generated Makefile. But at least that worked, up to a point. Even though I linked in Phobos, it crashed when I called writeln (but core.stdc.stdio.printf was ok).I have embedded Ruby in a D application. Called methods in both directions. I had no problem. Have a look at this mostly abandoned project [1]. The bindings where created from 1.9.1 (ABI version). Here [2] are the C bindings and here [3] are some wrappers.Trying to use the C API directly from D didn't really work. I tried dstep on ruby.h and it threw an exception. Ah, macros...Please report an issue. It shouldn't be throwing an exception. [1] https://github.com/jacob-carlborg/orbit [2] https://github.com/jacob-carlborg/orbit/tree/master/ruby/c [3] https://github.com/jacob-carlborg/orbit/tree/master/ruby/core -- /Jacob Carlborg
Apr 13 2014
I have embedded Ruby in a D application. Called methods in both directions. I had no problem. Have a look at this mostly abandoned project [1]. The bindings where created from 1.9.1 (ABI version). Here [2] are the C bindings and here [3] are some wrappers.Interesting. How did you generate ruby.d and the other necessary interface files, by hand?I will. AtilaTrying to use the C API directly from D didn't really work. I tried dstep on ruby.h and it threw an exception. Ah, macros...Please report an issue. It shouldn't be throwing an exception.
Apr 14 2014
On 14/04/14 09:54, Atila Neves wrote:Interesting. How did you generate ruby.d and the other necessary interface files, by hand?I think it was with DStep and some manual tweaks. Otherwise it was just manually. -- /Jacob Carlborg
Apr 14 2014