Ruby's role in future operating systems

On 6/9/06, Louis J Scoras [email protected] wrote:

intended.

On 6/9/06, Kyrre N. [email protected] wrote:

You’re making a good point here. But to me it feels like a “if it works
don’t fix it” kind of thing. I mean, all in all, wouldn’t Ruby prevail?

Feel free to show me some examples though.

# mp32ogg [untested] - quick and dirty conversion:
mpg321 -w - somesong.mp3 | oggenc -o somesong.ogg -

Though one day perhaps:
require ‘mpg’
require ‘oggenc’
print Ogg.convertMpeg(Mpg.new(“somesong.mpg”))

Also, what if this operating system were to use a Ruby shell?

I believe this has been tried w/ several different languages before.
You could do it, but it’s not awefully convienent because most general
purpose languages weren’t designed for this (i.e.: they can’t be typed
as quickly).

I have been messing around with Rush and believe that a Ruby shell
could be quick and extremely useful. One idea that Reyn (the original
author) mentioned was the ability to pipe objects around instead of
just binary streams. So if piping syntax was easier, you could have
the equivalent of the above looking something like this:

Mpg.new(“somesong.mp3”) | Ogg.convertMpeg > new.ogg

Each method on the right side of the pipe then has a attr_writer
called “stdin” or some such and the interpreter assigns it to the
object on the left before executing the method.

Just ideas, but it could be really useful. Consider the age-old
problem of a new unix program suddenly producing a slightly different
text output, breaking many shell scripts. If the script rather
depended on Df[“/usr”].size instead of cutting up the text output from
the “df” program and hoping it still looks the same (or using df -P),
these scripts would be more reliable.

I used to have scores of bash scripts doing everything for me but
after learning Perl I disciplined myself to go to the extra effort of
writing a Perl program in order to sharpen my skills. All those bash
scripts that became Perl scripts are now Ruby scripts! Using OOP makes
them a breeze to maintain and extend and they fail much less often.

Les

On 6/10/06, M. Edward (Ed) Borasky [email protected] wrote:

But once Perl (4) came along, I tossed out “awk” and “sed” and even
fully intend to learn Ruby as a Perl replacement, but for now, the
neurons fire in Perl.

You are in for a treat. I went along the same path, but now most of my
scripts use objects and they are maintained with the greatest of ease.
Oh the massive Perl spaghetti that I have converted to a few lines of
elegant, easy-to-read Ruby makes me say: I think you should start
forcing yourself to do all new scripts in Ruby instead. You’ll be
happier almost immediately.

After working in Perl for so long, I like to think of Ruby as the
thing Perl is trying to be.

Les

Hello,

On 6/13/06, Leslie V. [email protected] wrote:

Mpg.new(“somesong.mp3”) | Ogg.convertMpeg > new.ogg

Why not
somesong.mp3 > new.ogg

It’s just a typecast…

Ilmari

On Jun 9, 2006, at 7:51 AM, Kyrre N. wrote:

I’m sure there are other parts that could be replaced by Ruby as well,
anybody know?

This won’t happen in FreeBSD. They took out perl and rewrote the
perl-using scripts in either /bin/sh or C because it was too hard to
keep perl up to date.


Eric H. - [email protected] - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com

Leslie V. wrote:

You are in for a treat. I went along the same path, but now most of my
scripts use objects and they are maintained with the greatest of ease.
Oh the massive Perl spaghetti that I have converted to a few lines of
elegant, easy-to-read Ruby makes me say: I think you should start
forcing yourself to do all new scripts in Ruby instead. You’ll be
happier almost immediately.

After working in Perl for so long, I like to think of Ruby as the
thing Perl is trying to be.
I think Matz would agree … he saw some things that were icky in Perl
and came up with something a lot better. Perl is to some extent saddled
with having more legacy code than the “younger” scripting languages.
Ruby reads more like a real programming language than a scripting
language.


M. Edward (Ed) Borasky