Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is no portable bytecode specification for Ruby, and thus also no standard way to load precompiled bytecode archives. However, almost all Ruby implementations use some kind of bytecode or intcode format, and several of them can dump and reload bytecode archives.</p> <p><a href="http://Ruby-Lang.Org/" rel="noreferrer">YARV</a> always compiles to bytecode before executing the code, however that is usually only done in memory. There are ways to dump out the bytecode to disk. <a href="https://GitHub.Com/RubySpec/MatzRuby/blob/trunk/iseq.c#L1427-1429" rel="noreferrer">At the moment, there is no way to read it back <em>in</em></a>, however. This will change in the future: work is underway on a bytecode verifier for YARV, and once that is done, bytecode can safely be loaded into the VM, without fear of corruption. Also, the JRuby developers have indicated that they are willing to implement a <a href="https://GitHub.Com/JRuby/JRuby/blob/da23e51968ffc17d750fca340f4b9538e5e2b425/src/org/jruby/ast/executable/YARVMachine.java" rel="noreferrer">YARV VM emulator inside JRuby</a>, once the YARV bytecode format and verifier are stabilized, so that you could load YARV bytecode into JRuby. (Note that this version is <a href="https://GitHub.Com/JRuby/JRuby/commit/2257c8f811fab8d675a942c86ab712922dc46c6f/" rel="noreferrer">obsolete</a>.)</p> <p><a href="http://Rubini.us/" rel="noreferrer">Rubinius</a> also always compiles to bytecode, and it has a <a href="https://GitHub.Com/EvanPhx/Rubinius/blob/master/kernel/compiler/compiled_file.rb" rel="noreferrer">format for compiled files</a> (<code>.rbc</code> files, analogous to JVM <code>.class</code> files) and there is talk about a bytecode archive format (<code>.rba</code> files, analogous to JVM <code>.jar</code> files). There is a chance that Rubinius might implement a YARV emulator, if deploying apps as YARV bytecode ever becomes popular. Also, the JRuby developers have indicated that they are willing to implement a <a href="https://GitHub.Com/JRuby/JRuby/blob/da23e51968ffc17d750fca340f4b9538e5e2b425/src/org/jruby/ast/executable/RubiniusMachine.java" rel="noreferrer">Rubinius bytecode emulator inside JRuby</a>, if Rubinius bytecode becomes a popular way of deploying Ruby apps. (Note that this version is <a href="https://GitHub.Com/JRuby/JRuby/commit/2257c8f811fab8d675a942c86ab712922dc46c6f/" rel="noreferrer">obsolete</a>.)</p> <p><a href="http://XRuby.GoogleCode.Com/" rel="noreferrer">XRuby</a> is a pure compiler, it compiles Ruby sourcecode straight to JVM bytecode (<code>.class</code> files). You can deploy these <code>.class</code> files just like any other Java application.</p> <p><a href="http://JRuby.Org/" rel="noreferrer">JRuby</a> started out as an interpreter, but it has both a JIT compiler and an <a href="https://GitHub.Com/JRuby/JRuby/tree/master/src/org/jruby/compiler/" rel="noreferrer">AOT compiler</a> (<code>jrubyc</code>) that can compile Ruby sourcecode to JVM bytecode (<code>.class</code> files). Also, work is underway to create a <a href="https://GitHub.Com/JRuby/JRuby/blob/master/tool/compiler2.rb" rel="noreferrer"><em>new</em> compiler that can compile (type-annotated) Ruby code to JVM bytecode</a> that actually looks like a Java class and can be used from Java code without barriers.</p> <p><a href="http://RubyDotNETCompiler.GoogleCode.Com/" rel="noreferrer">Ruby.NET</a> is a pure compiler that compiles Ruby sourcecode to CIL bytecode (PE <code>.dll</code> or <code>.exe</code> files). You can deploy these just like any other CLI application.</p> <p><a href="http://IronRuby.Net/" rel="noreferrer">IronRuby</a> also compiles to CIL bytecode, but typically does this in-memory. However, you can pass <a href="https://GitHub.Com/IronRuby/IronRuby/blob/master/Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyOptionsParser.cs#L275-276" rel="noreferrer">commandline switches to it</a>, so it dumps the <code>.dll</code> and <code>.exe</code> files out to disk. Once you have those, they can be deployed normally.</p> <p><a href="https://SDN.SAP.Com/irj/scn/wiki?path=/display/Research/BlueRuby" rel="noreferrer">BlueRuby</a> automatically pre-parses Ruby sourcecode into BRIL (BlueRuby Intermediate Language), which is basically a serialized parsetree. (See <a href="https://SDN.SAP.Com/irj/scn/go/portal/prtroot/docs/library/uuid/408a9a3b-03f9-2b10-b29c-f0a3374b19d8" rel="noreferrer"><em>Blue Ruby - A Ruby VM in SAP ABAP</em></a>(PDF) for details.)</p> <p>I <em>think</em> (but I am definitely not sure) that there is a way to get <a href="https://GitHub.Com/Cardinal/Cardinal/" rel="noreferrer">Cardinal</a> to dump out <a href="http://ParrotCode.Org/" rel="noreferrer">Parrot</a> bytecode archives. (Actually, Cardinal only compiles to PAST, and then Parrot takes over, so it would be Parrot's job to dump and load bytecode archives.)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload