A Ruby Operating System (no bashing please)

Hello,

this post might sound strange, but after working with ruby for so long,
I’ve been thinking about writing a ruby operating system. I’ve been
thinking about doing my M.D. thesis about it, but I want to hear some
of your opinions.

First of all, the philosophical questions :slight_smile:

  • Does it make any sense? (that is, does it sound useful?)
  • It has been done before?

And then the technical stuff. I though about doing things this way:

  1. Make the ruby VM run on bare metal. (that is, a ruby VM operating
    system)
  2. Make the standard ruby libraries
  3. Make SO libraries

For step 1, the logical approach (for me) would be something like this:

  1. Get the ruby source.
  2. Write a replacement for every libc function ruby uses.
  3. Compile ruby into a kernel and boot it.

Does this sound like a logic approach? Or there’s any better way to do
it, or I should go for a different path here?

Thank you in advance,

Andr

André wrote:

  • It has been done before?
  1. Get the ruby source.

I’m sorry, but I won’t answer to the post itself. I just can’t resist
reformat your subject:

A Ruby Operating System (no BASH:ing please)

of course, in a Ruby OS, BASH wouldn’t be allowed… =)

Regards

Ola B. (http://ola-bini.blogspot.com)
JvYAML, RbYAML, JRuby and Jatha contributor
System Developer, Karolinska Institutet (http://www.ki.se)
OLogix Consulting (http://www.ologix.com)

“Yields falsehood when quined” yields falsehood when quined.

AndréI’m sorry, but I won’t answer to the post itself. I just can’t resist
reformat your subject:

A Ruby Operating System (no BASH:ing please)

of course, in a Ruby OS, BASH wouldn’t be allowed… =)

Well… I figured that a title like “(no IRB:ing please)” would be just
plain wrong… :wink:

Andr

André wrote:

Hello,
this post might sound strange, but after working with ruby for so
long,
I’ve been thinking about writing a ruby operating system. I’ve been
thinking about doing my M.D. thesis about it, but I want to hear some
of your opinions.
First of all, the philosophical questions :slight_smile:

  • Does it make any sense? (that is, does it sound useful?)
  • It has been done before?

You might want to take a look at Inferno (http://www.vitanuova.com/
inferno/).
It is an OS based on a virtual machine model.

Another possibility would be creating a Ruby interface to the Plan 9
operating system. Currently the Ruby libraries are crafted to interface
to Posix-like OSs and Windows. Re-thinking the core libraries in the
context of something like Plan 9 or Inferno might be interesting.

Gary W.

Well, I can’t really speak to how you should go about it, but it does
sound
pretty interesting. I’d love to see it in action if you get it running
=).

~Myles

…it sounds very interesting…but i would start with rubinius since
it’s a self booting like squeak … then write the entire OS in the ruby
language itself with only small c stubs for cpu critical dma access
things

On 1/25/07, André [email protected] wrote:

Hello,
this post might sound strange, but after working with ruby for so long,
I’ve been thinking about writing a ruby operating system. I’ve been
thinking about doing my M.D. thesis about it, but I want to hear some
of your opinions.

Sounds like a cool project. :slight_smile:

The first things that come to mind:

Perl:
http://perllinux.sourceforge.net/
A Linux distribution where ALL programs are written in perl:
The only compiled code in this Perl/Linux system is: Linux
Kernel,
perl, and uClibc.)

C#:
Shows | Microsoft Learn
Singularity (operating system) - Wikipedia
a Microsoft Research project started in 2003 to build a highly-
dependable operating system in which the kernel, device driver,
and applications are all written in managed code
http://sharpos.org/Main_Page
SharpOS is a look into the possibility and the challenge of
creating an operating system written in C# and based on Mono

Java:
JavaOS - Wikipedia
(As of 2006, Sun considers JavaOS a legacy system)
http://www.jnode.org/
Java New Operating System Design Effort

André wrote:

this post might sound strange, but after working with ruby for so long,
I’ve been thinking about writing a ruby operating system. I’ve been
thinking about doing my M.D. thesis about it, but I want to hear some
of your opinions.

First of all, the philosophical questions :slight_smile:

  • Does it make any sense? (that is, does it sound useful?)

Of course it does!

  • It has been done before?

A Ruby OS? Not that I know of. A dynamic language OS? Tons: various
Smalltalk OSes, LISP OSes. A VM OS? Several: Inferno, IBM OS/400,
NewOS, Microsoft Research’s Singularity.

The House operating system (Haskell) might be of interest to you.

And then the technical stuff. I though about doing things this way:

Well, I can’t comment on those. I’m just gonna be an excited
bystander, witnessing in awe …

Anyway, I kinda like the Singularity OS from Microsoft Research. The
most important thing about it is that MSR chose to do two things
radically different: over 4 decades the overarching goal of all
operating systems has been performance. And over 4 decades the design
of all operating systems has been driven by hardware innovations.

Singularity is different: its overarching design goal is dependability
and its design is driven by language and tools innovations (in the
case of Microsoft that obviously means statically verifiable/provable
safe programming languages (i.e. C#, Spec#, Sing#) and automatic
static program verification). And, I mean, they’re right: look at
today’s operating systems: most of them are implemented using
technology from the 70s (i.e. C) and if you look at it from way high
above then Windows Vista is still Digital VMS and Linux and MacOS X
are still MULTICS.

This language driven operating system design makes Singularity pretty
different from today’s mainstream operating systems and IMHO also
makes it pretty cool. (Of course there have been other similar
attempts before, I don’t mean to sound like a Microsoft fanboy,
because, actually, I ain’t one.)

You might wonder where I’m getting at … Well: I just wanted to say,
I’m looking forward to what interesting design choices a Ruby based OS
might lead to. Obviously it would look totally different from
Singularity (because of its strong roots in static verification) and
it would also look totally different from today’s mainstream systems.

As a closing remark, you might want to take a look at The TUNES
Project http://TUNES.Org/. They want to build an entirely new
operating system (well, actually an entirely new computing system,
including hardware, OS and language) based on the very latest and
greatest in dynamic languages, AI, cybernetics, … However, they have
been around for many years and all they have accomplished so far is
three relaunches of their website …

  1. Make the ruby VM run on bare metal. (that is, a ruby VM operating
    system)

Don’t forget: there’s more than one Ruby VM. JRuby and IronRuby might
be of interest to you because people have already gotten the JVM and
the CLR to run on bare metal. And of course Rubinius might be of very
great interest because it is written mostly in Ruby.

Anyway, I’m looking forward to what’s coming out of this, even if it’s
just a thread on ruby-talk that makes a nice evening’s read (-;

jwm

Jörg W Mittag wrote:

Singularity is different: its overarching design goal is dependability
and its design is driven by language and tools innovations (in the
case of Microsoft that obviously means statically verifiable/provable
safe programming languages (i.e. C#, Spec#, Sing#) and automatic
static program verification). And, I mean, they’re right: look at
today’s operating systems: most of them are implemented using
technology from the 70s (i.e. C) and if you look at it from way high
above then Windows Vista is still Digital VMS and Linux and MacOS X
are still MULTICS.

Yeah … and Digital VMS is still Xerox/Honeywell CP-V and RSX-11M. And
MVS is still DOS\360. :slight_smile:

As a closing remark, you might want to take a look at The TUNES
Project http://TUNES.Org/. They want to build an entirely new
operating system (well, actually an entirely new computing system,
including hardware, OS and language) based on the very latest and
greatest in dynamic languages, AI, cybernetics, … However, they have
been around for many years and all they have accomplished so far is
three relaunches of their website …

Ayup … then again, people don’t use Lisp Machines any more either,
because general-purpose computers caught up with them in
computations/buck. The cheese moves, you know. :slight_smile:


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

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

On Jan 25, 12:11 pm, “André” [email protected] wrote:

this post might sound strange, but after working with ruby for so long,
I’ve been thinking about writing a ruby operating system. I’ve been
thinking about doing my M.D. thesis about it, but I want to hear some
of your opinions.

How are you defining an ‘operating system’? The definitions I’m used to
involve managing all the low level aspects of the computer - hardware
interrupts, access to devices, memory allocation and management,
including virtual memory, etc.

Like: Operating system - Wikipedia

Given that the ruby interpretter itself relies on these things, I’d
think any Ruby-based operating system would be … well, I don’t know
what it would be. A ruby interpretter written in machine code that
handled all of this itself?

Do you mean a shell environment that accepts and uses Ruby code? Or the
“WebOS” term of a suite of applications covering all your daily needs,
all written in Ruby? Or truly an operating system?

On Jan 25, 11:21 pm, [email protected] wrote:

Perl:
and applications are all written in managed code
http://sharpos.org/Main_Page
SharpOS is a look into the possibility and the challenge of
creating an operating system written in C# and based on Mono

Java:
JavaOS - Wikipedia
(As of 2006, Sun considers JavaOS a legacy system)
http://www.jnode.org/
Java New Operating System Design Effort

Python:
http://unununium.org/

Thank you everyone for your kind answers. I’ll lookup the links you
guys provided, and do some research about it.

Thank you for the support also! It’s good to know that my idea is not
completely crazy…

Best regards!

Andr

André wrote:

Reminds me of a line from a special on modern physics I saw years ago on
public TV: “We all agree his idea is crazy, but is it crazy enough?”


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

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

André wrote:

  • It has been done before?

In a way it makes sense, and in a way it doesn’t. The two most notable
examples of very tight coupling between a language and an operating
system are the Lisp machines that used to grace AI labs, and the Forth
language, which, at its birth and for many years thereafter existed as a
combination language and real-time operating system. So where are they
now?

  1. The Lisp machines faded into obscurity, mostly because the
    price-performance numbers for general-purpose systems caught up with
    them. The same thing happened to other special-purpose machines like
    mini-supercomputers.

  2. Forth as a language has evolved in two directions. Forth still is
    used in its original modus operandi as a combination language and
    real-time OS, often on special chips designed to execute Forth
    efficiently. But it also has evolved into a language hosted on
    conventional operating systems like Windows and Linux. And there is an
    ANSI standard which covers both types of Forth usage.

Would a “Ruby machine” be useful in the same sense as a “Lisp machine”
was? It strikes me as vulnerable to the same thing that killed off the
Lisp machines – competition from general-purpose operating systems that
can run Ruby, Lisp, Perl, Fortran, Haskell, Erlang, C++, .NET, Java …

  1. Write a replacement for every libc function ruby uses.
  2. Compile ruby into a kernel and boot it.

Does this sound like a logic approach? Or there’s any better way to do
it, or I should go for a different path here?

Thank you in advance,

André

I don’t think there’s a “Ruby VM” yet. There are fairly complete ports
of Ruby to the JVM and the CLR, and there is a Ruby-specific VM called
YARV that is scheduled for its first release Christmas of this year. And
there are two other semi-functioning projects in the Ruby implementation
space – Cardinal, which is a port of Ruby to the Parrot virtual
machine, and Carbone, which is a port of Ruby to the gforth/vmgen
virtual machine.

None of these are really “operating systems” in the conventional sense
of the term. Operating systems manage processes, files, events, signals,
processors, memory and devices. A program written in Ruby manages
objects, classes of objects, methods, strings, regular expressions,
numbers, arrays, and hashes.


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

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

André wrote:

Hello,

this post might sound strange, but after working with ruby for so long,
I’ve been thinking about writing a ruby operating system. I’ve been
thinking about doing my M.D. thesis about it, but I want to hear some
of your opinions.

Well, there is http://unununium.org/
And I’m sure there are some java undertakings as well.

It’s not completely stupid or impossible. Might make some kind of
point in certain type of embedded solutions if it were stable and
efficient in at least some way (ease of customization?) - there would
have to be some highlighted feature, that nothing else has, to gain
any interest (outside of academia), I’d guess.

With the current state of ruby implementations, I would say it’s
pretty darn hard to get a good stable system without reimplementing a
somewhat posix-compliant system anyway (unless you hook on top of on
a
java-os project and go with jruby =)).

But, I’d very much like to see what sort of wacky stuff you could
come
up with something as dynamic and fun as ruby =)

A recent article in Linux Journal by David Lynch is about his efforts
of porting Linux to the FPGA E12 chipset…

Dynamic hardware + dynamic language = fun?

Markt