[ANN] Ruva: Pure-ruby toy (J)VM

Hi,

For anyone who's interested in this kind of stuff, I just uploaded my
pure-ruby toy JVM to Rubyforge. It's obviously very slow, but can be
useful for seeing how things work or debugging generated classes that
won't verify. It can do some reasonable class-dumps and execution
traces, too. It's probably about 70% complete, with most instructions
implemented, and currently has some integration with the GNU Classpath
runtime library.

http://ruva.rubyforge.org/
http://rubyforge.org/projects/ruva
svn checkout svn://rubyforge.org/var/svn/ruva/trunk

···

--
Ross Bamford - rosco@roscopeco.REMOVE.co.uk

Wow!

Hi,

For anyone who's interested in this kind of stuff, I just uploaded my
pure-ruby toy JVM to Rubyforge. It's obviously very slow, but can be
useful for seeing how things work or debugging generated classes that
won't verify. It can do some reasonable class-dumps and execution
traces, too. It's probably about 70% complete, with most instructions
implemented, and currently has some integration with the GNU Classpath
runtime library.

Okay, I'm boggled. This is really cool (even it it's just a toy).

···

On 10/9/06, Ross Bamford <rossrt@roscopeco.co.uk> wrote:

http://ruva.rubyforge.org/
http://rubyforge.org/projects/ruva
svn checkout svn://rubyforge.org/var/svn/ruva/trunk

--
Ross Bamford - rosco@roscopeco.REMOVE.co.uk

--
thanks,
-pate
-------------------------

That is very very cool. I'll definetely be playing with this.

···

On 10/9/06, Ross Bamford <rossrt@roscopeco.co.uk> wrote:

Hi,

For anyone who's interested in this kind of stuff, I just uploaded my
pure-ruby toy JVM to Rubyforge. It's obviously very slow, but can be
useful for seeing how things work or debugging generated classes that
won't verify. It can do some reasonable class-dumps and execution
traces, too. It's probably about 70% complete, with most instructions
implemented, and currently has some integration with the GNU Classpath
runtime library.

http://ruva.rubyforge.org/
http://rubyforge.org/projects/ruva
svn checkout svn://rubyforge.org/var/svn/ruva/trunk

--
Ross Bamford - rosco@roscopeco.REMOVE.co.uk

--
- Simen

So ... anyone up for JRuby on Ruva?

-austin

···

On 10/9/06, Ross Bamford <rossrt@roscopeco.co.uk> wrote:

For anyone who's interested in this kind of stuff, I just uploaded my
pure-ruby toy JVM to Rubyforge. It's obviously very slow, but can be
useful for seeing how things work or debugging generated classes that
won't verify. It can do some reasonable class-dumps and execution
traces, too. It's probably about 70% complete, with most instructions
implemented, and currently has some integration with the GNU Classpath
runtime library.

--
Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/
               * austin@halostatue.ca * You are in a maze of twisty little passages, all alike. // halo • statue
               * austin@zieglers.ca

Ross Bamford <rossrt@roscopeco.co.uk> writes:

Hi,

For anyone who's interested in this kind of stuff, I just uploaded my
pure-ruby toy JVM to Rubyforge. It's obviously very slow, but can be
useful for seeing how things work or debugging generated classes that
won't verify. It can do some reasonable class-dumps and execution
traces, too. It's probably about 70% complete, with most instructions
implemented, and currently has some integration with the GNU Classpath
runtime library.

Can it run JRuby? :wink:

···

Ross Bamford

--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org

Ross Bamford wrote:

For anyone who's interested in this kind of stuff, I just uploaded my
pure-ruby toy JVM to Rubyforge. It's obviously very slow, but can be
useful for seeing how things work or debugging generated classes that
won't verify. It can do some reasonable class-dumps and execution
traces, too. It's probably about 70% complete, with most instructions
implemented, and currently has some integration with the GNU Classpath
runtime library.

http://ruva.rubyforge.org/
http://rubyforge.org/projects/ruva
svn checkout svn://rubyforge.org/var/svn/ruva/trunk

Seriously though, this might have real applications in JRuby. Existing libraries for examining bytecodes are far from friendly, and having a nice API to examine classes and code could be useful. We're planning on writing the next iteration of the Ruby-bytecode compiler in Ruby, and having a library like this to examine the results will make that easier.

···

--
Charles Oliver Nutter, JRuby Core Developer
headius@headius.com -- charles.o.nutter@sun.com
Blogging at headius.blogspot.com

Ross Bamford wrote:

For anyone who's interested in this kind of stuff, I just uploaded my
pure-ruby toy JVM to Rubyforge. It's obviously very slow, but can be

I tried to play with it a bit but I don't have Classpath installed. Is there a way to read in classes for inspection without Classpath?

···

--
Charles Oliver Nutter, JRuby Core Developer
headius@headius.com -- charles.o.nutter@sun.com
Blogging at headius.blogspot.com

You're a sick man.

-- Matt
It's not what I know that counts. It's what I can remember in time to use.

···

On Tue, 10 Oct 2006, Austin Ziegler wrote:

So ... anyone up for JRuby on Ruva?

Christian Neukirchen wrote:

Ross Bamford <rossrt@roscopeco.co.uk> writes:

Hi,

For anyone who's interested in this kind of stuff, I just uploaded my
pure-ruby toy JVM to Rubyforge. It's obviously very slow, but can be
useful for seeing how things work or debugging generated classes that
won't verify. It can do some reasonable class-dumps and execution
traces, too. It's probably about 70% complete, with most instructions
implemented, and currently has some integration with the GNU Classpath
runtime library.

Can it run JRuby? :wink:

Why stop there? Can JRuby run Ruva?

···

--
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

What aboute the reverse -- load Ruva inside of JRuby -- or better (worse?)
still, JRuby inside of Ruva inside of JRuby -- now there's an incestuous
cycle. The image of two snakes eating each others' tail comes to mind.

/Nick

···

On 10/9/06, Christian Neukirchen <chneukirchen@gmail.com> wrote:

Ross Bamford <rossrt@roscopeco.co.uk> writes:

> Hi,
>
> For anyone who's interested in this kind of stuff, I just uploaded my
> pure-ruby toy JVM to Rubyforge. It's obviously very slow, but can be
> useful for seeing how things work or debugging generated classes that
> won't verify. It can do some reasonable class-dumps and execution
> traces, too. It's probably about 70% complete, with most instructions
> implemented, and currently has some integration with the GNU Classpath
> runtime library.

Can it run JRuby? :wink:

Austin Ziegler wrote:

···

On 10/9/06, Ross Bamford <rossrt@roscopeco.co.uk> wrote:

For anyone who's interested in this kind of stuff, I just uploaded my
pure-ruby toy JVM to Rubyforge. It's obviously very slow, but can be
useful for seeing how things work or debugging generated classes that
won't verify. It can do some reasonable class-dumps and execution
traces, too. It's probably about 70% complete, with most instructions
implemented, and currently has some integration with the GNU Classpath
runtime library.

So ... anyone up for JRuby on Ruva?

-austin

As long as it compiles extensions on Windows, sure. :slight_smile:

Me! Me!

Aww heck, it doesn't seem to work .... (yet ;))

···

On Tue, 2006-10-10 at 05:15 +0900, Austin Ziegler wrote:

So ... anyone up for JRuby on Ruva?

--
Ross Bamford - rosco@roscopeco.REMOVE.co.uk

Yeah, that kind of thing was the reason I started on Ruva last year.
Doing a lot of stuff with generated classes, and the JVM's preverifier
errors are, shall we say "unhelpful", to say the least ...

Anyway, I'll be glad (plus a bit surprised) if anything in there's of
use...

···

On Tue, 2006-10-10 at 07:21 +0900, Charles Oliver Nutter wrote:

Seriously though, this might have real applications in JRuby. Existing
libraries for examining bytecodes are far from friendly, and having a
nice API to examine classes and code could be useful. We're planning on
writing the next iteration of the Ruby-bytecode compiler in Ruby, and
having a library like this to examine the results will make that easier.

--
Ross Bamford - rosco@roscopeco.REMOVE.co.uk

Sure is. This gets a dump of a class just as it's read in (before it's
resolved):

pp
Ruva::VM::Class::Reader.file("test/java_classes/TestFunctional10.class")

The unresolved class returned by Reader.file is visitable too - there's
a bit of a basic TraceClassVisitor in ruva/utils/class_visitor.rb but it
gives too much output most of the time...

If you're after the code, it's easier to get the class resolved or
you'll have to find the code attributes yourself, so try something like:

loader = Ruva::VM::ClassLoader.new(nil, 'test/java_classes')
# => #<Ruva::VM::ClassLoader:0xb7dac098 ... >

clz = loader.load_class('TestFunctional10')
# => TestFunctional10

clz.methods.each { |m| puts m; Ruva::Utils::CodeDumper.print(m.code) }
# public void <init>(int)
# seq | bytes | mnemonic | operands
# ----------------------------------------------------------
# 0 | 0x0000..0x0000 | ALOAD_0 |
# 1 | 0x0001..0x0003 | INVOKESPECIAL | [0, 1]
# [ ... etc ... ]

Also, have a look at the bottom of class_loader.rb and a few others,
there are small test programs there sometimes...

Hope that helps,

···

On Tue, 2006-10-10 at 23:09 +0900, Charles Oliver Nutter wrote:

Ross Bamford wrote:
> For anyone who's interested in this kind of stuff, I just uploaded my
> pure-ruby toy JVM to Rubyforge. It's obviously very slow, but can be

I tried to play with it a bit but I don't have Classpath installed. Is
there a way to read in classes for inspection without Classpath?

--
Ross Bamford - rosco@roscopeco.REMOVE.co.uk

Thank you.

-austin

···

On 10/9/06, Matt Lawrence <matt@technoronin.com> wrote:

On Tue, 10 Oct 2006, Austin Ziegler wrote:
> So ... anyone up for JRuby on Ruva?
You're a sick man.

--
Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/
               * austin@halostatue.ca * You are in a maze of twisty little passages, all alike. // halo • statue
               * austin@zieglers.ca

Joel VanderWerf wrote:

Christian Neukirchen wrote:

runtime library.

Can it run JRuby? :wink:

Why stop there? Can JRuby run Ruva?

Can JRuby run Ruva running JRuby?

···

--
Posted via http://www.ruby-forum.com/\.

Christian Neukirchen wrote:
> Ross Bamford <rossrt@roscopeco.co.uk> writes:
>
>> Hi,
>>
>> For anyone who's interested in this kind of stuff, I just uploaded my
>> pure-ruby toy JVM to Rubyforge. It's obviously very slow, but can be
>> useful for seeing how things work or debugging generated classes that
>> won't verify. It can do some reasonable class-dumps and execution
>> traces, too. It's probably about 70% complete, with most instructions
>> implemented, and currently has some integration with the GNU Classpath
>> runtime library.
>
> Can it run JRuby? :wink:

Why stop there? Can JRuby run Ruva?

and why stop there ... how much work will it take to get JRuby on
Ruva on MetaRuby on Cardinal? I want to be able to read the
line of code currently being interpreted ;^)

···

On 10/9/06, Joel VanderWerf <vjoel@path.berkeley.edu> wrote:

--
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

--
thanks,
-pate
-------------------------

>
> Ross Bamford <rossrt@roscopeco.co.uk> writes:
>
> > Hi,
> >
> > For anyone who's interested in this kind of stuff, I just uploaded my
> > pure-ruby toy JVM to Rubyforge. It's obviously very slow, but can be
> > useful for seeing how things work or debugging generated classes that
> > won't verify. It can do some reasonable class-dumps and execution
> > traces, too. It's probably about 70% complete, with most instructions
> > implemented, and currently has some integration with the GNU Classpath
> > runtime library.
>
> Can it run JRuby? :wink:

What aboute the reverse -- load Ruva inside of JRuby -- or better (worse?)
still, JRuby inside of Ruva inside of JRuby -- now there's an incestuous
cycle. The image of two snakes eating each others' tail comes to mind.

This is *not* the Python Mailing List.
Robert

/Nick

···

On 10/9/06, Nick Sieger <nicksieger@gmail.com> wrote:

On 10/9/06, Christian Neukirchen <chneukirchen@gmail.com> wrote:

Hmm, y'know, there _is_ a JPython I believe.... :smiley:

···

On Tue, 2006-10-10 at 05:51 +0900, Nick Sieger wrote:

On 10/9/06, Christian Neukirchen <chneukirchen@gmail.com> wrote:
> Can it run JRuby? :wink:

What aboute the reverse -- load Ruva inside of JRuby -- or better (worse?)
still, JRuby inside of Ruva inside of JRuby -- now there's an incestuous
cycle. The image of two snakes eating each others' tail comes to mind.

--
Ross Bamford - rosco@roscopeco.REMOVE.co.uk

You are quite welcome. Hope to see you at RubyConf.

-- Matt
It's not what I know that counts. It's what I can remember in time to use.

···

On Tue, 10 Oct 2006, Austin Ziegler wrote:

On 10/9/06, Matt Lawrence <matt@technoronin.com> wrote:

On Tue, 10 Oct 2006, Austin Ziegler wrote:
> So ... anyone up for JRuby on Ruva?
You're a sick man.

Thank you.