[Rite] Byte-Code Compiler in Ruby

Discussion in 'Ruby' started by Michael Neumann, Nov 16, 2003.

  1. 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
    Michael Neumann, Nov 16, 2003
    #1
    1. Advertising

  2. il Mon, 17 Nov 2003 07:11:19 +0900, Michael Neumann
    <> 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..
    gabriele renzi, Nov 16, 2003
    #2
    1. Advertising

  3. > 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
    George Marrows, Nov 17, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John
    Replies:
    5
    Views:
    381
    Tina - AffordableHOST.com
    Dec 24, 2003
  2. RickMuller
    Replies:
    4
    Views:
    704
    Alexey Shamrin
    Mar 26, 2005
  3. Austin Ziegler

    Ruby => Rite, AST => Bytecode?

    Austin Ziegler, Jul 30, 2003, in forum: Ruby
    Replies:
    2
    Views:
    119
    Phil Tomson
    Jul 30, 2003
  4. Guest
    Replies:
    34
    Views:
    383
    Jim Freeze
    Aug 28, 2003
  5. Stephen Birch

    Ruby rite (Ruby 2.0) vaporware or real?

    Stephen Birch, Apr 4, 2005, in forum: Ruby
    Replies:
    10
    Views:
    541
    Lothar Scholz
    Apr 4, 2005
Loading...

Share This Page