c++rubyscriptingembedded-language

How to embed Ruby in C++?


What's the best way to embed Ruby as a scripting language in C++? Using ruby.h? SWIG? Something else? What I need is to expose some C++ objects to Ruby and have the Ruby interpreter evaluate scripts that access these objects. I don't care about extending Ruby or accessing it in C++.

I've found this article on embedding Ruby in C++, and while it's very useful, it's kinda old and I was wondering if there are any other resources on the subject (or open source implementations of similar engines).


Solution

  • swig is probablly the way to go..... but ruby doesnt embed too well......

    if you want a language that embeds nicely into C++, try lua