Ruby Compiler

Discussion in 'Ruby' started by Heesob Park, Mar 21, 2008.

  1. Heesob Park

    Heesob Park Guest

    Hi,

    I longed for a ruby byte code compiler.
    But I guess YARV is not stable until now.

    So I made a very experimental Ruby Compiler.
    Actually it is not a true compiler just ruby object dumper and loader.
    By modifing gc.c and eval.c , It cannot be distibuted as extension
    library.

    The main idea is simple.
    1. Dump all symbols,ids and node tree to a file.
    2. Load the symbols,ids and tree from a file and run.

    But I should have spent much time to understand how to parsing and
    evalualing
    the ruby code.

    With this compiler, you can secure your source code.
    And saving parsing time is the main advantage.
    Even the same object file can runs on Linux and Windows just like Java
    class.

    What do you think about this compiler?

    Regards,

    Park Heesob
    --
    Posted via http://www.ruby-forum.com/.
     
    Heesob Park, Mar 21, 2008
    #1
    1. Advertising

  2. Heesob Park

    Luis Lavena Guest

    On 21 mar, 14:49, Heesob Park <> wrote:
    > Hi,
    >
    > I longed for a ruby byte code compiler.
    > But I guess YARV is not stable until now.
    >
    > So I made a very experimental Ruby Compiler.
    > Actually it is not a true compiler just ruby object dumper and loader.
    > By modifing gc.c and eval.c , It cannot be distibuted as extension
    > library.
    >
    > The main idea is simple.
    > 1. Dump all symbols,ids and node tree to a file.
    > 2. Load the symbols,ids and tree from a file and run.
    >
    > But I should have spent much time to understand how to parsing and
    > evalualing
    > the ruby code.
    >
    > With this compiler, you can secure your source code.
    > And saving parsing time is the main advantage.
    > Even the same object file can runs on Linux and Windows just like Java
    > class.
    >
    > What do you think about this compiler?
    >


    Looks interesting , one question:

    Does the loading for the parsed/node tree generated dump avoid
    evaluation? I mean, there is no need to reparse it, right? If so, then
    you have a speed boost when loading pre-compiled ruby scripts and
    sounds good.

    How it handles reload of files (using load 'foo.rb' compares the mtime
    of the pre-compiled file with the source file?)

    Regards,
    --
    Luis Lavena
     
    Luis Lavena, Mar 21, 2008
    #2
    1. Advertising

  3. Heesob Park

    llothar Guest

    On 22 Mrz., 05:11, Luis Lavena <> wrote:
    > On 21 mar, 14:49, Heesob Park <> wrote:
    >
    >
    >
    > > Hi,

    >
    > > I longed for a ruby byte code compiler.
    > > But I guess YARV is not stable until now.

    >
    > > So I made a very experimental Ruby Compiler.
    > > Actually it is not a true compiler just ruby object dumper and loader.
    > > By modifing gc.c and eval.c , It cannot be distibuted as extension
    > > library.

    >
    > > The main idea is simple.
    > > 1. Dump all symbols,ids and node tree to a file.
    > > 2. Load the symbols,ids and tree from a file and run.

    >
    > > But I should have spent much time to understand how to parsing and
    > > evalualing
    > > the ruby code.

    >
    > > With this compiler, you can secure your source code.
    > > And saving parsing time is the main advantage.
    > > Even the same object file can runs on Linux and Windows just like Java
    > > class.

    >
    > > What do you think about this compiler?

    >
    > Looks interesting , one question:
    >
    > Does the loading for the parsed/node tree generated dump avoid
    > evaluation? I mean, there is no need to reparse it, right? If so, then
    > you have a speed boost when loading pre-compiled ruby scripts and
    > sounds good.
    >
    > How it handles reload of files (using load 'foo.rb' compares the mtime
    > of the pre-compiled file with the source file?)
    >


    This concept can only work on special written files that are not doing
    any
    evaluation during load. Unfortunately almost none of the files in the
    standard library do fit into this schema.
     
    llothar, Mar 21, 2008
    #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. Yan
    Replies:
    0
    Views:
    1,171
  2. Jack Wright
    Replies:
    5
    Views:
    663
    Shiv Kumar
    Jan 19, 2004
  3. Ram
    Replies:
    0
    Views:
    2,930
  4. Andrey Batyuck

    Compiler compiler with C++ as output

    Andrey Batyuck, May 11, 2004, in forum: C++
    Replies:
    3
    Views:
    457
    Frederik Hertzum
    May 17, 2004
  5. RickMuller
    Replies:
    4
    Views:
    751
    Alexey Shamrin
    Mar 26, 2005
Loading...

Share This Page