Is there a way to execute Ruby code from C/C++? I know it is possible
to call Tcl code from C/C++; the Tcl library provides a
Tcl_CreateInterp() function which creates an in-process interpreter
running the Tcl code. Does Ruby provide something similar?
Is there a way to execute Ruby code from C/C++? I know it is possible
to call Tcl code from C/C++; the Tcl library provides a
Tcl_CreateInterp() function which creates an in-process interpreter
running the Tcl code. Does Ruby provide something similar?
Yes it does. Search up "ruby c c++" (without quotes) in Google.
It seems that everything I find on the web is about calling C from
Ruby (which is C extensions). I need to do call Ruby from C.
Perhaps, you misunderstood the pages. I asked for you to search "ruby c c++" - Please see the following:
[1] From the first hit: http://metaeditor.sourceforge.net/embed/
In this document I will descripe how to embed the ruby interpreter into c++ [WhyEmbedRuby?, EmbedRuby] and provide you with a skeleton you easily can build upon.