Can I script a C++ application with Ruby like with Lua? -
i've started read ruby, , wondering if can embedded in c++ application lua provides library parse given script file: https://stackoverflow.com/a/5127294/399107
yes, can. need embed ruby engine in application.
note that, unlike main lua engine, ruby engines aren't suited being embedded other programs. but, example, rubinius, ironruby , jruby have been designed embedding in mind, , though isn't pretty, can embed yarv or mri well, though not designed it.
there's mruby, unlike others, doesn't implement full ruby language specification, implements subset of iso ruby specification small subset of intersection of ruby 1.8 , ruby 1.9. plus, hasn't been released yet, evidenced fact not its homepage exists yet. is, however, designed embedding, in both senses of word: being embedded other programs, , being useful on embedded device little ram.
as may have noticed, much easier embed ruby app if app running on java platform or cli. there are c++ compilers both java platform , cli, option not entirely out of question. otherwise, i'd rubinius easier embed, more people have tried embedding yarv, there more blog posts how that. (or maybe, embedding rubinius trivial nobody needs write blog posts it.)
a long time ago, working on implementation of ruby lua vm, implementation never went anywhere. solve problems, though :-)
Comments
Post a Comment