[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Plans for compiling Ruby to binary bytecode?

Joshua Melcon

5/5/2008 6:51:00 PM

Greetings,

My understanding is that Ruby internally uses a custom VM (virtual
machine) to execute. This VM has its own set of instructions
(bytecode). I was wondering whether or not there were any plans to
allow one to compile Ruby down to a set of these instructions and stick
it into a binary file (much like Java, or .NET) and then use the Ruby's
VM to execute it?

Thanks,

--JM
--
Posted via http://www.ruby-....

2 Answers

Philip Levin

5/6/2008 11:35:00 AM

0

Joshua Melcon wrote:
> Greetings,
>
> My understanding is that Ruby internally uses a custom VM (virtual
> machine) to execute. This VM has its own set of instructions
> (bytecode). I was wondering whether or not there were any plans to
> allow one to compile Ruby down to a set of these instructions and stick
> it into a binary file (much like Java, or .NET) and then use the Ruby's
> VM to execute it?
>
> Thanks,
>
> --JM

You can make an windows executable:
http://www.erikveen.dds.nl/rubyscript2exe/...

--
Posted via http://www.ruby-....

Tim Becker

5/7/2008 1:37:00 PM

0

> My understanding is that Ruby internally uses a custom VM (virtual
> machine) to execute. This VM has its own set of instructions
> (bytecode).

There are several different Ruby implementations:

* The 'default' is MRI (Matz's Ruby Impl), it's an interpreter, no bytecode
* The "Next Gen" MRI, the 1.9 series includes YARV, which is a VM
customized towards ruby
* There's Rubinius, which is a bootstrapped Ruby impl, written almost
entirely in Ruby, which uses custom bytecode as well
* JRuby is targeted towards JVM and (I think) can run either as an
interpreter or compile Ruby to Java bytecode.
* IronRuby is a CLI based Ruby Impl.

So, there's not just plans, the plans have long since been implemented
:) But the standard Ruby implementation currently doesn't use
bytecode.
Hope this helps,
-tim