From: Yogesh Sharma Date: 2005-04-03T23:35:12+09:00 Subject: Re: Embedding Ruby Interpretor in threaded C / C++ Hi gga, Thanks for perfect answer and pointers to Lua and Tcl. Yogesh gga wrote: > Hi, Yogesh. In ruby this is a tad worse, as there's basically no lock > of any kind so you can run into all sorts of race conditions. You can > obviously do what python does by providing your own lock before you > eval any ruby code, but I agree this is far from ideal. > There's also always only a single instance of the ruby interpreter > (which cannot even be re-inited, unlike python), so all your scripts > will share their global variables. > These are limitations of the current ruby interpreter and not of the > language. The ruby interpreter is being rewritten to address these > problems, but don't expect anything any time soon. > > If you need to do any of the above today, I highly recommend you look > into either Lua or TCL, both of which can keep different interpreter > contexts easily. Lua is still somewhat new but it does have a > relatively similar syntax to Ruby (at least as long as you don't do > much OO programming, where their OO model is a tad too cumbersome > compared to ruby or python). > If newer languages scare you, TCL is a very mature language which was > built with embedding in mind and has hundreds of libraries all around. > However, its syntax of brackets is a tad arcane. TCL was never built > with the idea of classes or advanced constructs in mind, so its > performance in that area is usually less than some more modern > languages. >