Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > [Rite] Byte-Code Compiler in Ruby

Reply
Thread Tools

[Rite] Byte-Code Compiler in Ruby

 
 
Michael Neumann
Guest
Posts: n/a
 
      11-16-2003
Hi,

I am fascinated by the many new ideas presented by matz for Rite.

Why not write the whole Ruby-to-Bytecode compiler in Ruby itself?

As the compilation step is executed less frequently, due to having lots
of precompiled bytecode binaries (one for each .rb file), this step is
not very time-critial (it's only done once for each file). And
applications using eval() are seldom evaluating very large parts of
code, or are itself time-critical.

This way, the Ruby-to-Bytecode compiler could be compiled itself into
bytecode, and then run on top of the Bytecode interpreter.

As one side-effect, the Bytecode interpreter would become relative easy
to implement. The compiler, too. And some other cool effects could be
done this way.

Is this "old" idea realistic for Rite?

Regards,

Michael

 
Reply With Quote
 
 
 
 
gabriele renzi
Guest
Posts: n/a
 
      11-16-2003
il Mon, 17 Nov 2003 07:11:19 +0900, Michael Neumann
<(E-Mail Removed)> ha scritto::

>Hi,
>
>I am fascinated by the many new ideas presented by matz for Rite.
>
>Why not write the whole Ruby-to-Bytecode compiler in Ruby itself?
>


google for 'metaruby'. You may discover something like this is being
done and is not so easy..
 
Reply With Quote
 
 
 
 
George Marrows
Guest
Posts: n/a
 
      11-17-2003
> Is this "old" idea realistic for Rite?

I would say yes. ByteCodeRuby's compiler is implemented in Ruby, which
greatly simplifies things. I haven't looked at the speed of
compilation, which will of course be slower than a C-based version,
but I agree with you that this isn't likely to critically affect
overal performance.

Quick plug: ByteCodeRuby is a (as yet incomplete) bytecode compiler
and interpreter for Ruby. For simplicity it reuses a lot of the
current VM, sharing its parser, class model, standard library and GC.
Version 0.2.0 has just been released on rubyforge:
http://rubyforge.org/projects/bytecoderuby/

-- George
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiler Error Message: The compiler failed with error code -1073741819 Ram ASP .Net 0 09-13-2005 09:52 AM
Why is a JIT compiler faster than a byte-compiler RickMuller Python 4 03-26-2005 04:30 PM
Compiler compiler with C++ as output Andrey Batyuck C++ 3 05-17-2004 08:17 PM
Can we use <compiler> tag to avoid RunTime Compiler error? Jack Wright ASP .Net 5 01-19-2004 04:36 PM
Compiler Error Message: The compiler failed with error code 128. Yan ASP .Net 0 07-21-2003 10:49 PM



Advertisments