# Vuby - VM for Ruby

**URL:** <https://rubytalk.org/t/vuby-vm-for-ruby/11655>\
**Category:** ruby-talk\
**Created:** [20 May 2004 19:39 UTC](https://rubytalk.org/t/vuby-vm-for-ruby/11655 "2004-05-20T19:39:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mystifier1](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@Mystifier1](https://rubytalk.org/u/Mystifier1)\
**Post date:** [20 May 2004 19:39 UTC](https://rubytalk.org/t/vuby-vm-for-ruby/11655/1 "2004-05-20T19:39:34Z")

</div>

Hi all,

I have been working on vuby for a month. I feel now that this should be open  
source but GPL is not yet decided. I want it to be a commercially viable and  
usable.

I understand matz that it should not be in C++ but since I am not language  
expert like matz, My level of confusion will be very less in C++.

The details I have finalized are:

Code in C++  
Initial target only win32  
will have initially only interpreter but will include JIT compiler by  
version 1.0 release. might as well have Ahead of Time compiler.  
Will share bytecodes with java as much as possible.  
will be using subversion

About license I feel it should not be GPL but an open source application  
which will if bought give you right to modify but not copy. If you wish to  
creates n copies you should buy n licenses.

What do you all think?

rolo

---

<div class="post-metadata">

**Author:** ![Mark10](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Mark10](https://rubytalk.org/u/Mark10)\
**Post date:** [20 May 2004 20:12 UTC](https://rubytalk.org/t/vuby-vm-for-ruby/11655/2 "2004-05-20T20:12:34Z")

</div>

rolo wrote:

> About license I feel it should not be GPL but an open source application  
> which will if bought give you right to modify but not copy. If you wish to  
> creates n copies you should buy n licenses.

Using this license your application won’t be open source, at least not  
according to the Open Source Definition, which states that an open  
source application should be freely redistributable.

[http://www.opensource.org/docs/definition.php](http://www.opensource.org/docs/definition.php)

If you do decide to license you program in this way then I think it  
would be misleading to call it open source.

> What do you all think?

There are a couple of projects on Rubyforge which create vm’s for ruby  
that you might want to look at.

[http://rubyforge.org/projects/bytecoderuby/](http://rubyforge.org/projects/bytecoderuby/)  
[http://rubyforge.org/projects/yarv/](http://rubyforge.org/projects/yarv/)

> **···**
>
> –  
> Mark Sparshatt

---

<div class="post-metadata">

**Author:** ![Ptkwt](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@Ptkwt](https://rubytalk.org/u/Ptkwt)\
**Post date:** [20 May 2004 20:38 UTC](https://rubytalk.org/t/vuby-vm-for-ruby/11655/3 "2004-05-20T20:38:46Z")

</div>

In article [ACEPLIKLBKEMDDIELPKIEECCCFAA.rohitlodha@hotwireindia.com](mailto:ACEPLIKLBKEMDDIELPKIEECCCFAA.rohitlodha@hotwireindia.com),

> Hi all,
> 
> I have been working on vuby for a month. I feel now that this should be open  
> source but GPL is not yet decided. I want it to be a commercially viable and  
> usable.
> 
> I understand matz that it should not be in C++ but since I am not language  
> expert like matz, My level of confusion will be very less in C++.
> 
> The details I have finalized are:
> 
> Code in C++  
> Initial target only win32  
> will have initially only interpreter but will include JIT compiler by  
> version 1.0 release. might as well have Ahead of Time compiler.  
> Will share bytecodes with java as much as possible.

So it will be a super-set of the current JVM?

> will be using subversion
> 
> About license I feel it should not be GPL but an open source application  
> which will if bought give you right to modify but not copy. If you wish to  
> creates n copies you should buy n licenses.

That’s not opensource. You can’t restrict copying in an opensource  
license.

If you want to open source your code and allow people in inudustry to use  
it then maybe you should use Ruby’s current library or a BSD type license.

BTW: have you taken a look on the RubyGarden wiki. There are several  
RubyVM projects going on. Check out:

> **[WebMD - Better information. Better health.](https://www.webmd.com/?VirtualMachineOptions)**
>
> The leading source for trustworthy and timely health and medical news and information. Providing credible health information, supportive community, and educational services by blending award-winning expertise in content, community services, expert...

Phil

> **···**
>
> rolo [rohitlodha@hotwireindia.com](mailto:rohitlodha@hotwireindia.com) wrote:

---

<div class="post-metadata">

**Author:** ![Matt\_Lawrence1](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@Matt\_Lawrence1](https://rubytalk.org/u/Matt_Lawrence1)\
**Post date:** [20 May 2004 23:41 UTC](https://rubytalk.org/t/vuby-vm-for-ruby/11655/4 "2004-05-20T23:41:59Z")

</div>

> Code in C++  
> Initial target only win32  
> will have initially only interpreter but will include JIT compiler by  
> version 1.0 release. might as well have Ahead of Time compiler.  
> Will share bytecodes with java as much as possible.  
> will be using subversion

I don’t use Windows for anything but playing games, so I may not do  
anything with it until a Linux version becomes available.

> About license I feel it should not be GPL but an open source application  
> which will if bought give you right to modify but not copy. If you wish to  
> creates n copies you should buy n licenses.
> 
> What do you all think?

I think that the copyright gives you the right to control the distribution  
of your work however you like.

On a related topic, Baen Books has been including CD with some of their  
books that are copyrighted with the restriction that copies can be given  
away, but may not be sold (not even to recover costs). I think that is  
really cool.

– Matt  
The American Non-Sequiteur Society: We may not make sense, but we do like  
pizza.

> **···**
>
> On Fri, 21 May 2004, rolo wrote:

---

<div class="post-metadata">

**Author:** ![SASADA\_Koichi](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/sasada_koichi/32/2374_2.png) [@SASADA\_Koichi](https://rubytalk.org/u/SASADA_Koichi)\
**Post date:** [20 May 2004 21:24 UTC](https://rubytalk.org/t/vuby-vm-for-ruby/11655/5 "2004-05-20T21:24:10Z")

</div>

Mark Sparshatt [msparshatt@yahoo.co.uk](mailto:msparshatt@yahoo.co.uk) wrote :  
[Re: vuby - VM for Ruby]  
at Fri, 21 May 2004 05:12:34 +0900

Hi.

> [http://rubyforge.org/projects/yarv/](http://rubyforge.org/projects/yarv/)

I moved project homepage to [YARV: Yet Another Ruby VM](http://www.atdot.net/yarv/)

BTW it’s good idea to implement JIT compiler. But how? If you can,  
please tell me some idea(or papers, or some reference) to realise JIT  
compiler.

Some JIT compilers are developed(in Japan, the most famous one is shuJIT,  
java jit compiler), but it’s strongly depend on each processor(or OS)  
architecture. I’m looking for some easy way to achieve this(Is it a magic? :)).

For the moment, I will implement JIT compiler with the  
‘dynamic replication’(or something like this).  
(from ‘Optimizing indirect branch prediction accuracy in virtual machine interpreters’  
[http://portal.acm.org/citation.cfm?id=781162&dl=ACM&coll=portal](http://portal.acm.org/citation.cfm?id=781162&dl=ACM&coll=portal))

Regards,  
ko1

> **···**
>
> –  
> // SASADA Koichi at atdot dot net  
> //

---

<div class="post-metadata">

**Author:** ![Laurent\_Julliard4](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@Laurent\_Julliard4](https://rubytalk.org/u/Laurent_Julliard4)\
**Post date:** [21 May 2004 12:48 UTC](https://rubytalk.org/t/vuby-vm-for-ruby/11655/6 "2004-05-21T12:48:54Z")

</div>

did you noticed libjit ?  
[http://www.southern-storm.com.au/doc/libjit/libjit\_toc.html](http://www.southern-storm.com.au/doc/libjit/libjit_toc.html)

> **···**
>
> il Fri, 21 May 2004 06:24:10 +0900, SASADA Koichi [ko1@atdot.net](mailto:ko1@atdot.net) ha scritto::
> 
> > BTW it’s good idea to implement JIT compiler. But how? If you can,  
> > please tell me some idea(or papers, or some reference) to realise JIT  
> > compiler.

---

<div class="post-metadata">

**Author:** ![SASADA\_Koichi](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/sasada_koichi/32/2374_2.png) [@SASADA\_Koichi](https://rubytalk.org/u/SASADA_Koichi)\
**Post date:** [21 May 2004 13:28 UTC](https://rubytalk.org/t/vuby-vm-for-ruby/11655/7 "2004-05-21T13:28:56Z")

</div>

gabriele renzi [surrender\_it@rc1.vip.ukl.yahoo.com](mailto:surrender_it@rc1.vip.ukl.yahoo.com)  
Fri, 21 May 2004 21:48:54 +0900 / Re: vuby - VM for Ruby

> did you noticed libjit ?  
> [http://www.southern-storm.com.au/doc/libjit/libjit\_toc.html](http://www.southern-storm.com.au/doc/libjit/libjit_toc.html)

nice 🙂  
Does anyone use this library?  
It’s easy to use?

Regards,  
ko1

---

<div class="post-metadata">

**Author:** ![Ptkwt](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@Ptkwt](https://rubytalk.org/u/Ptkwt)\
**Post date:** [21 May 2004 17:08 UTC](https://rubytalk.org/t/vuby-vm-for-ruby/11655/8 "2004-05-21T17:08:48Z")

</div>

In article [e8ura0t2q439rnst5pl4s1htjl41nalsv6@4ax.com](mailto:e8ura0t2q439rnst5pl4s1htjl41nalsv6@4ax.com),

> **···**
>
> gabriele renzi [surrender\_it@remove.yahoo.it](mailto:surrender_it@remove.yahoo.it) wrote:
> 
> > il Fri, 21 May 2004 06:24:10 +0900, SASADA Koichi [ko1@atdot.net](mailto:ko1@atdot.net) ha  
> > scritto::
> > 
> > > BTW it’s good idea to implement JIT compiler. But how? If you can,  
> > > please tell me some idea(or papers, or some reference) to realise JIT  
> > > compiler.
> > 
> > did you noticed libjit ?  
> > [http://www.southern-storm.com.au/doc/libjit/libjit\_toc.html](http://www.southern-storm.com.au/doc/libjit/libjit_toc.html)
> 
> That’s interesting. What a great idea: put all the JIT functionality into  
> a reusable library.
> 
> Thanks for the link!
> 
> Phil

---

<div class="post-metadata">

**Author:** ![Chalmers](https://avatars.discourse-cdn.com/v4/letter/c/a87d85/32.png) [@Chalmers](https://rubytalk.org/u/Chalmers)\
**Post date:** [24 May 2004 09:40 UTC](https://rubytalk.org/t/vuby-vm-for-ruby/11655/9 "2004-05-24T09:40:40Z")

</div>

SASADA Koichi wrote:

> gabriele renzi [surrender\_it@rc1.vip.ukl.yahoo.com](mailto:surrender_it@rc1.vip.ukl.yahoo.com)  
> Fri, 21 May 2004 21:48:54 +0900 / Re: vuby - VM for Ruby
> 
> > did you noticed libjit ?  
> > [http://www.southern-storm.com.au/doc/libjit/libjit\_toc.html](http://www.southern-storm.com.au/doc/libjit/libjit_toc.html)
> 
> nice 🙂  
> Does anyone use this library?  
> It’s easy to use?

I started wrapping it in a Ruby extension. Problem is it requires C++  
linker (it uses C++ to implement exceptions) and I didn’t push further  
on how to integrate that mkmf et al. I think it is doable though and  
would make for a nice Ruby compiling backend so please go ahead. Mind  
you it currently only has an interpreter for implementing the the  
“bytecode functionality” but the author told me that an X86 back-end is  
expected in the 1-2 months time frame.

Regards,

Robert Feldt

---

<div class="post-metadata">

**Author:** ![George2](https://avatars.discourse-cdn.com/v4/letter/g/8e7dd6/32.png) [@George2](https://rubytalk.org/u/George2)\
**Post date:** [24 May 2004 14:43 UTC](https://rubytalk.org/t/vuby-vm-for-ruby/11655/10 "2004-05-24T14:43:47Z")

</div>

> > did you noticed libjit ?  
> > [http://www.southern-storm.com.au/doc/libjit/libjit\_toc.html](http://www.southern-storm.com.au/doc/libjit/libjit_toc.html)
> 
> nice 🙂  
> Does anyone use this library?  
> It’s easy to use?

Hmm … it’s GPL. No problem with that generally, but how good a fit is  
it with the liberal licences of Ruby and other scripting languages?

As Robert pointed out a while back, there’s also LLVM. It isn’t  
intending to do quite the same thing as libjit (it requires a  
pre-compilation step), but seems to be well-established & is designed  
for sophisticated optimisations. The PyPy people have been active on  
their mailing list.

– George

PS Robert/Gabriele - where _do_ you find the time for all your  
excellent web research? 🙂
