title: Embedding a Ruby interpreter in a C++ app
body: <p>I'm hoping to use Ruby as a scripting language for my game engine. I've found the usual articles describing how to call Ruby classes from C++ code and vice versa (e.g. <a href="http://aeditor.rubyforge.org/ruby_cplusplus/index.html" rel="noreferrer">here</a>) but I can't quite see how to do what I want with that way of working...</p>
  
  <p>My engine currently uses a little language I wrote myself with Flex and Bison, and a little stack based virtual machine. Scripts don't always run right through from start to finish, for instance they sometimes includes commands like "sleep for 2 seconds" or "wait until character has finished walking", so the scheduler keeps tabs on the status of each script and an instruction pointer, and knows when to resume them, and so on.</p>
  
  <p>So it seems that I really need some kind of embedded Ruby interpreter that I can exercise a certain degree of control over, rather than simply calling Ruby methods. Or am I just being obtuse and missing something?</p>
  
  <p>I'm working in Microsoft Visual C++, so ideally any solution would compile nice and easily in that.</p>