On Dec 5, 7:40 am, "Just Another Victim of the Ambient Morality"
<ihates... / hotmail.com> wrote:
> "Nobuyoshi Nakada" <n... / ruby-lang.org> wrote in message
>
> news:20071205061035.DD12DE0697 / mail.bc9.jp...
>
>
>
> > Hi,
>
> > At Wed, 5 Dec 2007 14:25:07 +0900,
> > Just Another Victim of the Ambient Morality wrote in [ruby-talk:282132]:
> >> "Nobuyoshi Nakada" <n... / ruby-lang.org> wrote in message
> >>news:20071205020914.E6311E0666 / mail.bc9.jp...
> >> > Hi,
>
> >> > At Wed, 5 Dec 2007 08:40:11 +0900,
> >> > Just Another Victim of the Ambient Morality wrote in
> >> > [ruby-talk:282100]:
> >> >>     Why is there any "converting" to do?  How can this not work?
> >> >>     My best guess is that the Range class is not written in Ruby and,
> >> >> hence,
> >> >> has funny limitation on how it may work.
>
> >> > Yes, and performance issue.
>
> >>     Just so I'm clear on this; the Range class is implemented in C for
> >> performance reasons?
>
> > It isn't the only reason why Range is implemented in C, I wrote
> > about your "limitation."
>
>     Where did you write about this?  I'd be happy to read it...
>
> > If Range were written in Ruby, it couldn't be used until
> > something was loaded.  It wasn't acceptable for intrinsic
> > classes.
>
>     Okay, this makes more sense to me.  So, some built-in classes use Range
> and they couldn't if it were written in Ruby.
>     This brings up several issues.  One would be, why not?  Wouldn't it be
> nice if the Ruby interpreter's built in classes could be written in Ruby?

Well, might be nice for people who want to hack on very low-level ruby
stuff without going into the C, but not a good idea. PyPy (a python
interpreter written in python) is a factor of 2000 times slower(!)
than cPython when running on top of cPython. Implementing the base
classes of ruby in ruby, would have similar negative performance
impact.

> Now, I understand that implementation issues can be hard to solve but it's
> certainly something to keep in mind for something like Ruby 1.9 or Rite...
>     Another issue would be: did they have to use a long?  Just 'cause the
> implementation of Range is written in C doesn't mean that they couldn't
> still use Bignum, does it?  More to the point, couldn't the Ruby C code be
> written so that it didn't care what type was passed in, as long as they
> supported integral operations?  I'd be surprised if it couldn't...
>     Thank you...

Looks like Nobu posted the patches above.

Regards,
Jordan