Lightweight Ruby?

Hi all,

I was the one who started the “Using Ruby in a commercial application?”
thread.
Thanks for all the replies!

After some more consideration on using Ruby embedded in C++ for games,
it
started to become clear that the main reason that I wouldn’t want to use
it
yet is because of portability and lightweightness.

Lua which is more widely used in games is a lot more lightweight and
portable.

The main reason this is important to me is that porting games to
different
platforms might be a problem if the scripting language used isn’t
portable
to other platforms.

But I really like the Ruby language/syntax … I just wish there was a
more
lightweight version of it that is more portable. Heavy features such as
threads wouldn’t be required so that it could be more lightweight.

Anyways, I searched the archives and found a few people saying they were
working on something like this. Also there is something called “minruby”
which doesn’t have any documentation.

Anyone know of any information about a lightweight Ruby project or is
working on one?

Thank you!,
Chanon

What do you mean by lightweight? Ruby certainly seems to be portable,
in that it can be implemented on Mac OS X, Windows, Linux, BSD, BeOS,
OS/2, Solaris, AIX, etc. Are you looking to implement Ruby on an
embedded device like a PDA, Smartphone, game console, etc.?

Cganon,

I don’t believe it’s a matter of being light, it’s simply a matter of
security. Embedded scripting engines within games must heavily limit a
language’s capabilities to avoid malicious intent. Lua for example, used
within WoW, is very primitive by design.

There are examples of this in the Java community as well. RoboCode,
written within IBM and now open source uses Java’s security manager to
restrict callers from creating threads or getting access to system
resources.

I believe that it would be incredibly complex to implenent safe guards
in an open class system but hopefully I am terribly misguided. :slight_smile:

ilan

Chanon S. wrote:

Hi all,

But I really like the Ruby language/syntax … I just wish there was a
more
lightweight version of it that is more portable. Heavy features such as
threads wouldn’t be required so that it could be more lightweight.

Hmm. I would think your options might be more restricted to proprietary
software tools provided by the gaming console manufacturers. Otherwise
your work would be more of a modded deal that wouldn’t be as easy to
distribute commercially (if that’s your ultimate goal).

I am not an authority on console game programming by any stretch, but I
am not sure if Ruby would be a viable option in this area. Ruby doesn’t
have many up-to-date implementations for PDA’s and Smartphone, let
alone a game console. Maybe there’s projects out there I am not aware
of perhaps…

Yes, Nintendo DS and other game consoles could be future targets.

The thing is, to invest in a technology (including training employees to
learn it, developing libraries and tools for it) I’d like to be assured
that
it will be a future proof decision.

Thank you!

----- Original Message -----
From: “gregarican” [email protected]
Newsgroups: comp.lang.ruby
To: “ruby-talk ML” [email protected]
Sent: Tuesday, August 15, 2006 9:45 PM
Subject: Re: Lightweight Ruby?

Lua embeds much easier than Ruby, IMHO. This is especially if you use
multiple threads (which most games do, I believe).

Best tool for the job isn’t always your favorite tool :slight_smile:

-Brian

ps: ruby threads are lightweight, they are not system/posix threads

I believe that it would be incredibly complex to implenent safe guards
in an open class system but hopefully I am terribly misguided. :slight_smile:

Why’s sandbox (see another current thread) might help here.

Of course, I’ll be packaging Ruby 1.8.5 for iPAQ/linux as soon as it is
released. Lightweight in my sense is smaller packages. I’ll be using
ruby,
readline, irb and openssl only. I packaged network stuff separately in
the
past, but a PDA without network seems a bit useless. Oh, this will be
unpacked onto jffs2, which is a compressed FS, so the actual flash-usage
isn’t much higher.

~/iPAQ/Ruby/ruby-1.8.5/ipkg$ wc *ipk
34 202 8344 erb1.8_1.8.5-preview3-1_arm.ipk
7 30 634 erb_1.8.5-preview3-1_arm.ipk
118 619 30304 irb1.8_1.8.5-preview3-1_arm.ipk
8 29 636 irb_1.8.5-preview3-1_arm.ipk
43 308 16210 ruby1.8-curses_1.8.5-preview3-1_arm.ipk
1387 8625 494482 ruby1.8-dev_1.8.5-preview3-1_arm.ipk
446 2429 115234 ruby1.8-doc_1.8.5-preview3-1_arm.ipk
231 1476 87676 ruby1.8-openssl_1.8.5-preview3-1_arm.ipk
22 150 7496 ruby1.8-readline_1.8.5-preview3-1_arm.ipk
305 1489 66108 ruby1.8-rexml_1.8.5-preview3-1_arm.ipk
109 594 25956 ruby1.8-rss_1.8.5-preview3-1_arm.ipk
14 79 2534 ruby1.8-runit_1.8.5-preview3-1_arm.ipk
192 1106 51064 ruby1.8-soap_1.8.5-preview3-1_arm.ipk
94 555 25262 ruby1.8-test_1.8.5-preview3-1_arm.ipk
139 762 33818 ruby1.8-webrick_1.8.5-preview3-1_arm.ipk
80 461 23358 ruby1.8-wsdl_1.8.5-preview3-1_arm.ipk
96 548 22922 ruby1.8-xmlrpc_1.8.5-preview3-1_arm.ipk
57 329 14210 ruby1.8-xsd_1.8.5-preview3-1_arm.ipk
75 353 15630 ruby1.8-yaml_1.8.5-preview3-1_arm.ipk
3048 18428 987842 ruby1.8_1.8.5-preview3-1_arm.ipk
7 32 648 ruby_1.8.5-preview3-1_arm.ipk
6512 38604 2030368 total

On 8/16/06, Brian McCallister [email protected] wrote:

Lua embeds much easier than Ruby, IMHO. This is especially if you use
multiple threads (which most games do, I believe).

Best tool for the job isn’t always your favorite tool :slight_smile:

-Brian

Lua is also a nifty language :). Lua and Ruby seem to have the same
goals of being simple and fun to program in. Lua isn’t
object-oriented, but you can implement OOP in it and do a whole lot of
other nifty tricks using its peculiar data types.

I briefly looked at Lua but didn’t get a chance to fully research its
capabilities. Are there a decent amount of libraries available for this
language? For example, could I implement XMLRPC, SOAP, etc. with it or
use standard GUI toolkits such as Qt, GTK, Fox, Wx, etc.?

On Aug 17, 2006, at 7:00 AM, gregarican wrote:

I briefly looked at Lua but didn’t get a chance to fully research its
capabilities. Are there a decent amount of libraries available for
this
language? For example, could I implement XMLRPC, SOAP, etc. with it or
use standard GUI toolkits such as Qt, GTK, Fox, Wx, etc.?

I sure hope so. The language doesn’t even implement bitwise
operators, so your going to need a library for pretty much
everything. :wink:

James Edward G. II

This Ruby for a Linux-based iPAQ sounds great! By chance would this be
running on the Opie platform? Around 2002-2003 I played around with
Opie and liked what I saw then. If it’s not then which Open Embedded
distro is it?

On 8/16/06, Kero [email protected] wrote:

Of course, I’ll be packaging Ruby 1.8.5 for iPAQ/linux as soon as it is
released. Lightweight in my sense is smaller packages. I’ll be using ruby,
readline, irb and openssl only. I packaged network stuff separately in the
past, but a PDA without network seems a bit useless. Oh, this will be
unpacked onto jffs2, which is a compressed FS, so the actual flash-usage
isn’t much higher.

I would include zlib if you haven’t already; otherwise, you won’t be
able to use RubyGems.

-austin

On 8/17/06, gregarican [email protected] wrote:

I briefly looked at Lua but didn’t get a chance to fully research its
capabilities. Are there a decent amount of libraries available for this
language? For example, could I implement XMLRPC, SOAP, etc. with it or
use standard GUI toolkits such as Qt, GTK, Fox, Wx, etc.?

I know less of Lua than I know of Ruby, but a quick Google turned this
up:

http://luaforge.net

After looking at the site a bit, I saw it does have libraries for all
of the protocols/GUI toolkits you mention, tough some of them seem to
be at an early stage of development.

Also, since Lua was meant to be embedded into a C program, there’s a
protocol to call C functions from Lua, and vice-versa, so if you need
a certain funcionality from a C library, you could probably use it
without having to build a wrapper for the entire library.

On 2006-08-17, gregarican [email protected] wrote:

This Ruby for a Linux-based iPAQ sounds great! By chance would this be
running on the Opie platform? Around 2002-2003 I played around with
Opie and liked what I saw then. If it’s not then which Open Embedded
distro is it?

It runs on familiar. Both GPE and Opie derive from that, so it should
work
like a charm. Note that I have not added bindings for either gtk (for
GPE)
or Qt (for Opie). I should really try both.

On 2006-08-17, Austin Z. [email protected] wrote:

On 8/16/06, Kero [email protected] wrote:

Of course, I’ll be packaging Ruby 1.8.5 for iPAQ/linux as soon as it is
released. Lightweight in my sense is smaller packages. I’ll be using ruby,
readline, irb and openssl only. I packaged network stuff separately in the
past, but a PDA without network seems a bit useless. Oh, this will be
unpacked onto jffs2, which is a compressed FS, so the actual flash-usage
isn’t much higher.

I would include zlib if you haven’t already; otherwise, you won’t be
able to use RubyGems.

zlib is in the main package.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs