[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. Advertisements

  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. Advertisements

  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. Advertisements

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:
    526
    Tina - AffordableHOST.com
    Dec 24, 2003
  2. Chris Wright
    Replies:
    2
    Views:
    396
    Chris Wright
    Aug 8, 2003
  3. RickMuller
    Replies:
    4
    Views:
    903
    Alexey Shamrin
    Mar 26, 2005
  4. napi
    Replies:
    1
    Views:
    445
    QuantumG
    Sep 25, 2004
  5. gelonida
    Replies:
    1
    Views:
    952
    Gabriel Genellina
    May 6, 2010
  6. Austin Ziegler

    Ruby => Rite, AST => Bytecode?

    Austin Ziegler, Jul 30, 2003, in forum: Ruby
    Replies:
    2
    Views:
    246
    Phil Tomson
    Jul 30, 2003
  7. Guest
    Replies:
    34
    Views:
    577
    Jim Freeze
    Aug 28, 2003
  8. Stephen Birch

    Ruby rite (Ruby 2.0) vaporware or real?

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