On Wed, Oct 02, 2002 at 08:01:04AM +0900, William Djaja Tjokroaminata wrote:
> I don't know, Alan; just like Java, probably some typing is currently the
> only obvious way to make Ruby run even faster, but people are saying that
> it is not the Ruby way.  If there is indeed a new technology that can make
> Ruby run faster without some typing, that will indeed be the right way to
> go.

My whole point was that you might want to consider exploring
optimizations with ruby as is. Optimizations may be more difficult,
but they are certainly possible. When you have application running a
ruby codebase, an optimizing ruby engine (ORE?).  In many cases,
parameters passed to function and method calls will be primarily of
the same type. Say function foo(x).  In the codebase, maybe x is never
anything but an Array. ORE then creates a block of optimized machine
code assuming x is an array with some detection logic to fallback to
the regular code if x is not an array. Maybe ORE has a "profile" mode,
builds up some run profiling data and them builds the optimized machine
code based on the profile. Or the programmer looks over the profile data
and picks which functions with what type signature to build optimized
code for -- all while keeping the Ruby language largely intact, and not 
intruducing static typing to function prototypes.

> In my dream language, the typing is optional, and then I will add 'struct'
> (not the current Ruby Struct), so that member data "@data" is not accessed
> through hash anymore, but through memory offset.  It will take me some
> time to learn lex and yacc and the Ruby interpreter.  As already
> commented, probably eventually I will have to take the task myself (if I
> have the time).

I think that implementing offset based struct would be a good introduction
to the Ruby-C interface. 

-- 
Alan Chen
Digikata LLC
http://digikata.com