Embedded Ruby?

I start a new job shortly, and I have to maintain an 8051-based
assembly-language program. I have already been told that one of my first
tasks will be to consider migrating it to a new language, to ease the
difficulty of finding people to maintain it. Being 8051-based, resources
are at a premium. It occurs to me that embedding Ruby is one possible
option. Is there any information available on how to do this? Does one
just build the source code (in C), and bundle a Ruby script in with it?
Any hints gratefully accepted.

···


Steve Merrick

“Who cares, wins”

P.S. I’ve seen stuff about ‘eRuby’ - which I assume is ‘embedded Ruby’,
but I can’t seem to find it again… :frowning:

I start a new job shortly, and I have to maintain an 8051-based
assembly-language program. I have already been told that one of my first
tasks will be to consider migrating it to a new language, to ease the
difficulty of finding people to maintain it. Being 8051-based, resources
are at a premium. It occurs to me that embedding Ruby is one possible
option. Is there any information available on how to do this? Does one
just build the source code (in C), and bundle a Ruby script in with it?
Any hints gratefully accepted.


Steve Merrick

“Who cares, wins”

P.S. I’ve seen stuff about ‘eRuby’ - which I assume is ‘embedded Ruby’,
but I can’t seem to find it again… :frowning:

eruby is probably useless to you in this context.
It refers to Ruby code embedded in text files (like
a templating system), not embedded into devices.

I don’t think there’s been much done in the way of
embedding Ruby. There may even be some significant
technical obstacles. Others will know more than I.

Hal Fulton

···

----- Original Message -----
From: “Steve Merrick” Steve.Merrick@anti-spam.Marconi.com.web-hosting.com
Newsgroups: comp.lang.ruby
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Monday, June 24, 2002 7:51 AM
Subject: Embedded Ruby?

Ruby is a heavy user of RAM. It’s unlikely that it would be a good
choice for your system. It’s also not small itself:

$ size -t /usr/local/lib/libruby.so.1.6 /lib/i686/libc.so.6
/lib/i686/libm.so.6
text data bss dec hex filename
592269 7572 56788 656629 a04f5 /usr/local/lib/libruby.so.1.6
1226837 19296 16832 1262965 134575 /lib/i686/libc.so.6
133386 452 84 133922 20b22 /lib/i686/libm.so.6
1952492 27320 73704 2053516 1f558c (TOTALS)

Though I hate to say it, your best bet is probably to use C. There is
the SDCC compiler (http://sdcc.sourceforge.net/) which is free and
targets the 8051, and there are commercial compilers as well.

···

On Monday 24 June 2002 05:51 am, Steve Merrick wrote:

I start a new job shortly, and I have to maintain an 8051-based
assembly-language program. I have already been told that one of my
first tasks will be to consider migrating it to a new language, to
ease the difficulty of finding people to maintain it. Being
8051-based, resources are at a premium. It occurs to me that
embedding Ruby is one possible option. Is there any information
available on how to do this? Does one just build the source code
(in C), and bundle a Ruby script in with it? Any hints gratefully
accepted.


Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE

In article af74ao$mfv$1@newsfeed.pit.comms.marconi.com,

I start a new job shortly, and I have to maintain an 8051-based
assembly-language program. I have already been told that one of my first
tasks will be to consider migrating it to a new language, to ease the
difficulty of finding people to maintain it. Being 8051-based, resources
are at a premium. It occurs to me that embedding Ruby is one possible
option. Is there any information available on how to do this? Does one
just build the source code (in C), and bundle a Ruby script in with it?
Any hints gratefully accepted.

Hmmm… unless somebody has built a very stripped down version of Ruby or
unless the 8051’s address space has been seriously increased since I
worked with 'em back in the late '80s, I really doubt you’ll get Ruby to
work in that environment. As I recall the 8051 addresses 64K, but there
were some other versions that came out that could address 128K by use of
some special tricks. I kind of doubt you would be able to get Ruby to
play in that small of an address space and still be able to run any useful
programs with it… Could you convince’em to move to the StrongARM? :wink:

“Who cares, wins”

P.S. I’ve seen stuff about ‘eRuby’ - which I assume is ‘embedded Ruby’,
but I can’t seem to find it again… :frowning:

I think eRuby has something to do with embedding Ruby in HTML… not what
you think.

Phil

···

Steve Merrick Steve.Merrick@anti-spam.Marconi.com wrote:

Try to use eiffel. Small footprint, easy to program and learn and very
good for writing reliable programs.

···

On Mon, 24 Jun 2002 15:08:36 GMT, Ned Konz ned@bike-nomad.com wrote:

On Monday 24 June 2002 05:51 am, Steve Merrick wrote:

I start a new job shortly, and I have to maintain an 8051-based
assembly-language program. I have already been told that one of my
first tasks will be to consider migrating it to a new language, to
ease the difficulty of finding people to maintain it. Being
8051-based, resources are at a premium. It occurs to me that
embedding Ruby is one possible option. Is there any information
available on how to do this? Does one just build the source code
(in C), and bundle a Ruby script in with it? Any hints gratefully
accepted.

Ruby is a heavy user of RAM. It’s unlikely that it would be a good
choice for your system. It’s also not small itself:

$ size -t /usr/local/lib/libruby.so.1.6 /lib/i686/libc.so.6
/lib/i686/libm.so.6
text data bss dec hex filename
592269 7572 56788 656629 a04f5 /usr/local/lib/libruby.so.1.6
1226837 19296 16832 1262965 134575 /lib/i686/libc.so.6
133386 452 84 133922 20b22 /lib/i686/libm.so.6
1952492 27320 73704 2053516 1f558c (TOTALS)

Though I hate to say it, your best bet is probably to use C. There is
the SDCC compiler (http://sdcc.sourceforge.net/) which is free and
targets the 8051, and there are commercial compilers as well.