Nathan Mates wrote:
> DLPnet wrote:
>>just a quick question, I m currently considering using a scripting
>>language and I m looking at Ruby or LUA. Both of them seem really
>>suitable for *my needs* so I would just like your advice about these 2
>>languages. Not a deep review of each of them but just if anyone has a
>>strong opinion for or against.
>
> I've not used Ruby, but have done a lot of work with Lua. I feel
> that it's really, really easy to embed Lua into a C/C++ app, and call
> the other language's functions. Lua's memory footprint is also nice
> and small, but that's more of a consideration for console games. Lua
> doesn't have as much of a debugger built-in, but if you're happy with
> printf debugging, it works out quite well.
>
> Python/Ruby seem to be quite happy running scripts under Windows/
> Mac/Unix/etc, as a standalone app. I've heard that embedding Python is
> more work than Lua, due to more refcount issues, etc.
Embedding Ruby into a C++ app is absurdly easy. It's competitive with Lua,
easier than Python, and much easier than Perl.
However, the definition of a "soft language" is a language that puts the
needs of the programmer above the needs of the CPU. Ruby will never run
faster than Lua, because Lua is somewhat more difficult to program. You
get
many Ruby benefits (dynamic typing, extensible cl*****, metaprogramming,
and
block closures), but without Ruby's amazingly lean syntax.
Tip: Make certain your 'im****t' or 'require' or 'include' system works.
You
must write a little more Lua glue code to get that (because Lua can't make
assumptions about your file system). Once you do, you can grow
full-featured
cl***** in Lua and re-use them. Some games have ****pped with 2/3rds their
code in Lua and only 1/3rd in C++. That's fine because Lua runs very fast.
--
Phlip
http://flea.sourceforge.net/PiglegToo_1.html


|