Forum: Ruby A Ruby Operating System (no bashing please)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
André (Guest)
on 2007-01-25 21:15
(Received via mailing list)
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 :-)

- 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
Ola B. (Guest)
on 2007-01-25 21:24
(Received via mailing list)
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é (Guest)
on 2007-01-25 21:35
(Received via mailing list)
> > 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... ;-)

Andr
Donald M. (Guest)
on 2007-01-25 21:39
(Received via mailing list)
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
unknown (Guest)
on 2007-01-25 21:58
(Received via mailing list)
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 :-)
> - 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.
Dave R. (Guest)
on 2007-01-25 23:57
..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
unknown (Guest)
on 2007-01-26 00:22
(Received via mailing list)
On 1/25/07, André <removed_email_address@domain.invalid> 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.  :)

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#:
    http://channel9.msdn.com/ShowPost.aspx?PostID=68302
    http://en.wikipedia.org/wiki/Singularity_(operating_system)
        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:
    http://en.wikipedia.org/wiki/JavaOS
        (As of 2006, Sun considers JavaOS a legacy system)
    http://www.jnode.org/
        Java New Operating System Design Effort
Gavin K. (Guest)
on 2007-01-26 01:06
(Received via mailing list)
On Jan 25, 12:11 pm, "André" <removed_email_address@domain.invalid> 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: http://en.wikipedia.org/wiki/Operating_system

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?
Jörg W Mittag (Guest)
on 2007-01-26 02:45
(Received via mailing list)
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 :-)
>
> - 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
M. Edward (Ed) Borasky (Guest)
on 2007-01-26 05:43
(Received via mailing list)
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. :)
> 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. :)

--
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.
M. Edward (Ed) Borasky (Guest)
on 2007-01-26 06:14
(Received via mailing list)
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 ...

> 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é
>
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.
AdSR (Guest)
on 2007-01-26 13:50
(Received via mailing list)
On Jan 25, 11:21 pm, removed_email_address@domain.invalid 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:
>    http://en.wikipedia.org/wiki/JavaOS
>         (As of 2006, Sun considers JavaOS a legacy system)
>    http://www.jnode.org/
>         Java New Operating System Design Effort

Python:
   http://unununium.org/
André (Guest)
on 2007-01-26 14:56
(Received via mailing list)
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
M. Edward (Ed) Borasky (Guest)
on 2007-01-26 16:22
(Received via mailing list)
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.
Mikko L. (Guest)
on 2007-01-26 20:52
(Received via mailing list)
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 =)
Mark T (Guest)
on 2007-01-27 03:50
(Received via mailing list)
A recent article in Linux Journal by David Lynch is about his efforts
of porting Linux to the FPGA E12 chipset..
http://delivery.acm.org/10.1145/1200000/1194959/93...

Dynamic hardware + dynamic language = fun?

Markt
This topic is locked and can not be replied to.