Question to all you newbies (others welcome)

Dear Experts.

I come from LEAF user community.

I’m a damn stupid newbie about RUBY.
I just impresed by someone who post about how easy to write a JABBER
client
using ruby.

Since I come from a community of users of Small linux distro, my concern
is
about a micro Ruby “distro” (maybe like Micro Perl)

So Here is my question :

  1. Is there anyone can give me a list of extremely minimal files that
    have
    to be compiled to got ruby core interreter work properly ?
  2. What is the minimal libs have to be loaded/compiled to write :
    ++ Jabber client
    ++ BASH similar : Cat, Cut, sed

I’m intended to compile of that minimal files with uCLib … and may be
create a “*.lrp” package for the LEAF community.

Sincerely
-bino-

Phrogz wrote:

writing/designing skill) they are far better without a patch,
because they let you focus on the problem at hand, and not some
particularly foolish fix they propose.

When someone tells me I have a misspelling or that something is
rendering poorly in Opera, that’s fine.

When I get three pages of “Here’s why your site sucks”, that’s a
different story.

Somewhere in between, people should start considering that time spent
complaining about 10 things could be spent fixing any one of them.


James B.

“I was born not knowing and have had only a little
time to change that here and there.”

  • Richard P. Feynman

bino_oetomo wrote:

So Here is my question :

  1. Is there anyone can give me a list of extremely minimal files that have
    to be compiled to got ruby core interreter work properly ?
    I can’t answer this directly, but you may wish to see how Debian have
    handled this - they’ve split Ruby up into several different packages for
    (as far as I know) precisely this purpose.

On 4/8/07, Alex Y. [email protected] wrote:

  1. Is there anyone can give me a list of extremely minimal files that have
    to be compiled to got ruby core interreter work properly ?
    how Debian have
    handled this - they’ve split Ruby up into several different packages

Yeah, without providing a dependency package that just installs
EVERYTHING. Thereby creating a big maintenance headache for every Ruby
application out there. Grr…

On Sun, Apr 08, 2007 at 10:05:24PM +0900, bino_oetomo wrote:

I’m intended to compile of that minimal files with uCLib … and may be
create a “*.lrp” package for the LEAF community.

A full Ruby distribution is about one-third of the size of a base Perl
distribution, and yet includes a lot of stuff missing from base Perl
(such
as openssl libraries)

Now, I can’t give you an exact answer to your question. If you look at
ext/Setup you’ll see a bunch of ‘optional’ C libraries you can disable
or
enable. You can leave them all disabled of course, but things like
‘socket’
would be important for network clients.

However, most of the libraries supplied with Ruby are written in Ruby.
You’ll have to look at the sizes of them and decide which you want to
leave
out. If you don’t want an XML parser, then you can leave out REXML (but
then
again, Jabber is an XML-based protocol I believe).

Regards,

Brian.

On 4/8/07, Alexey V. [email protected] wrote:

On 4/8/07, Alex Y. [email protected] wrote:

  1. Is there anyone can give me a list of extremely minimal files that have
    to be compiled to got ruby core interreter work properly ?
    how Debian have
    handled this - they’ve split Ruby up into several different packages

Yeah, without providing a dependency package that just installs
EVERYTHING. Thereby creating a big maintenance headache for every Ruby
application out there. Grr…

I haven’t actually had any problem due to this in Debian or Ubuntu,
but that might be considered a bug. You could at least file one and
see what the devs say… :slight_smile:

Alex Y. wrote:

Since I come from a community of users of Small linux distro, my
for (as far as I know) precisely this purpose.

Well … I know nothing about LEAF. :slight_smile: But here’s a few hints that might
jog someone’s memory.

  1. During the course of installing Perl from source, an entity called
    “Mini Perl” (Minnie Pearl??) is generated. miniperl is used to bootstrap
    the install and is, I think, still resident on your system when the full
    Perl install has completed.

  2. During the course of installing Ruby from source, there is a
    “miniruby” built with similar uses. I don’t remember whether miniruby
    still exists after the install is done.

  3. Micro Perl, on the other hand, is a separate project. It is a
    stripped down Perl interpreter suitable for usage on “embedded” systems.
    It has its own web site.

  4. As far as I know, there is no “Micro Ruby” project, although I think
    it’s a great idea for someone who’s into such things.

So for the original poster, I’d start by downloading the source Ruby
distribution and doing “configure”, “make” and “make install” and
capture the log files of the operations. You’ll see “miniperl” go by,
and you can figure out how it’s built, what it’s used for and where it
ends up. Or maybe someone else on the list can pick up where my
knowledge leaves off. I haven’t dug into this because I’m doing other
things. :slight_smile:


M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)
http://borasky-research.net/

If God had meant for carrots to be eaten cooked, He would have given
rabbits fire.

On Mon, Apr 09, 2007 at 03:16:42AM +0900, M. Edward (Ed) Borasky wrote:

So for the original poster, I’d start by downloading the source Ruby
distribution and doing “configure”, “make” and “make install” and
capture the log files of the operations. You’ll see “miniperl” go by,
and you can figure out how it’s built, what it’s used for and where it
ends up. Or maybe someone else on the list can pick up where my
knowledge leaves off. I haven’t dug into this because I’m doing other
things. :slight_smile:
.gsub!(/perl/, ‘ruby’)

Chad P. wrote:

.gsub!(/perl/, ‘ruby’)

Uh, yeah :slight_smile: And:

  1. The “miniruby” executable is left behind in the build directory but
    apparently it isn’t installed anywhere.
  2. It is (on Linux, anyhow) an executable.

$ file miniruby
miniruby: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
GNU/Linux 2.6.9, dynamically linked (uses shared libs), not stripped

  1. It can at least do this:

$ ./miniruby -e ‘puts “Hello, world!”’
Hello, world!

So there you have it. What else miniruby can do I can’t tell you. But
it’s there after a build and apparently not installed.


M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)
http://borasky-research.net/

If God had meant for carrots to be eaten cooked, He would have given
rabbits fire.

Hi …
----- Original Message -----
From: “Chad P.” [email protected]
To: “ruby-talk ML” [email protected]
Sent: Monday, April 09, 2007 1:47 AM
Subject: Re: Minimum ruby installation.


CCD CopyWrite Chad P. [ http://ccd.apotheon.org ]
print substr(“Just another Perl hacker”, 0, -2);

Kindly please don’t missunderstanding about me.
I am not PERL hacker.
I’m just a LEAF (ucBering) user.
The only scripting language that I “knew” currently is BASH.
I never get in touch with servers … the only network engine that I got
in
touch is Router and Firewall.
And I’m dreaming of using ruby (and Jabber protocol) as two-way network
management system.

sincerely
-bino-

  1. Is there anyone can give me a list of extremely minimal files that have
    to be compiled to got ruby core interreter work properly ?
  2. What is the minimal libs have to be loaded/compiled to write :
    ++ Jabber client
    ++ BASH similar : Cat, Cut, sed

It seems others have done work on embedded systems
with Ruby before, so this may be useful.

some links on MiniRuby:

http://wiki.rubygarden.org/Ruby/page/search?search_data[title_data]=miniruby&commit=in+Body

please let us know about your project progress

good luck !

On 4/8/07, Kristoffer Lundén [email protected] wrote:

Yeah, without providing a dependency package that just installs
EVERYTHING. Thereby creating a big maintenance headache for every Ruby
application out there. Grr…

I haven’t actually had any problem due to this in Debian or Ubuntu,
but that might be considered a bug. You could at least file one and
see what the devs say… :slight_smile:

I am not a Debian user, but in a couple of years of me being Instiki
maintainer I’ve seen perhaps a hundred “help me!” emails that
eventually came down to that same problem.

Needless to say, none of these people were experienced Ruby
programmers, they just wanted to use the application.

bino_oetomo wrote:

CCD CopyWrite Chad P. [ http://ccd.apotheon.org ]
print substr(“Just another Perl hacker”, 0, -2);

Kindly please don’t missunderstanding about me.
I am not PERL hacker.

Chad P.'s signatures are more-or-less randomly generated.


Phillip “CynicalRyan” Gawlowski
http://cynicalryan.110mb.com/

Rule of Open-Source Programming #11:

When a developer says he will work on something, he or she means
“maybe”.

On Mon, Apr 09, 2007 at 10:57:27AM +0900, Phillip G. wrote:

bino_oetomo wrote:

CCD CopyWrite Chad P. [ http://ccd.apotheon.org ]
print substr(“Just another Perl hacker”, 0, -2);

Kindly please don’t missunderstanding about me.
I am not PERL hacker.

Chad P.'s signatures are more-or-less randomly generated.

Indeed.

I’m thinking of replacing the current script I use for that by writing
one in Ruby. I’m going to keep the Perl sig in the list, though.

Perhaps a small advert for RubyMentor in the Welcome message for this
mailing list would be a nice idea?

On 4/8/07, M. Edward (Ed) Borasky [email protected] wrote:

$ ./miniruby -e ‘puts “Hello, world!”’
Hello, world!

So there you have it. What else miniruby can do I can’t tell you. But
it’s there after a build and apparently not installed.

It’s a build tool, which is why it’s not installed. It’s used to
bootstrap building the real ruby since some of the installation tools
like instruby.rb, and extmk.rb are written in Ruby so a minimal ruby
is needed to install ruby!

What it can and can’t do is a little mysterious, and appears to be
platform dependent.

http://article.gmane.org/gmane.comp.lang.ruby.general/68084

Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

RubyMentor should request a link and a blurb on as many of the Ruby
and Rails local user group sites as possible. This is surely one of
the most effective and useful ways to reach a mentor locally!

Rick DeNatale wrote:

like instruby.rb, and extmk.rb are written in Ruby so a minimal ruby
is needed to install ruby!

What it can and can’t do is a little mysterious, and appears to be
platform dependent.

http://article.gmane.org/gmane.comp.lang.ruby.general/68084
In any event, I doubt if it will ever be something “supported for
general use and widely useful”, which is what I suspect the original
poster wants. I haven’t had much chance to fool around with Rubinius
yet, but that looks to me like the way to get something like this –
most of Rubinius is written in “the real Ruby” and should be capable of
making a micro Ruby interpreter.


M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)
http://borasky-research.net/

If God had meant for carrots to be eaten cooked, He would have given
rabbits fire.

On 4/8/07, Alex Y. [email protected] wrote:

I can’t answer this directly, but you may wish to see how Debian have
handled this - they’ve split Ruby up into several different packages for
(as far as I know) precisely this purpose.

Except that Debian got it wrong and split some things out based on
politics instead of technical considerations (e.g., the openssl issue
in Debian). And split things out further than they should have been.

To answer the OP: you definitely don’t need Tk by default. You need
zlib and openssl to get full RubyGems (including signed gem) support.
Jabber can be handled with Jabber4R which requires REXML (included
with the Ruby stdlib).

-austin

On Sun, Apr 08, 2007 at 10:05:24PM +0900, bino_oetomo wrote:

  1. Is there anyone can give me a list of extremely minimal files that have
    to be compiled to got ruby core interreter work properly ?

You have to compile the whole thing. If you wish, you can disable the
building of the C native extensions (such as socket, zlib etc) - but
they
all are built as separate .so loadable modules, so you might as well
just
build them and then not copy them onto the target system if you don’t
want
them.

  1. What is the minimal libs have to be loaded/compiled to write :
    ++ Jabber client
    ++ BASH similar : Cat, Cut, sed

Your Jabber client will need at least socket, and probably an XML parser
like REXML. There may be a higher-level Jabber library which you can
use.

Bash-like functionality probably doesn’t need any libraries, although
you
might want readline.

I’m intended to compile of that minimal files with uCLib … and may be
create a “*.lrp” package for the LEAF community.

In case it’s of interest, there’s a ruby-1.8.6 package for OpenWrt

https://dev.openwrt.org/browser/packages/lang/ruby

I made a squashfs filesystem containing for a complete OpenWrt
installation
with all the usual bits (kernel, uclibc etc) plus ruby with an almost
complete(*) set of ruby libraries, and the whole lot takes 2.8MB. So it
fits
quite nicely in a device with 4MB flash.

It might be possible to slice’n’dice the ruby standard libraries so that
parts can be omitted, but deciding how to put them into coherent bundles
may
be hard, and other people would probably disagree with your choices. For
example, you could argue that all XML and YAML plus everything that
depends
on them (e.g. SOAP, XMLRPC) should go in a library bundle. But that
wouldn’t
be much use to you, as your Jabber client would probably want at least
REXML, in which case you’ll end up loading everything else.

If memory really is that tight, I’d say it’s probably easier to work the
other way round: start with just ruby and no libraries. Give your
application a lib/ directory and manually install in there all the
libraries
that you find you need to make it work.

Regards,

Brian.

(*) Actually, rdoc, test::unit and nkf are in separate packages and I
left
these out. But it includes all the rest of the .rb libraries, plus C
extensions such as socket and yaml, and irb.