[#25272] [Feature #2032] Change the license to "GPLv2+ or Ruby's original". — Yui NARUSE <redmine@...>

Feature #2032: Change the license to "GPLv2+ or Ruby's original".

51 messages 2009/09/02
[#25368] [Feature #2032] Change the license to "GPLv2+ or Ruby's original". — Kazuhiko Shiozaki <redmine@...> 2009/09/04

Issue #2032 has been updated by Kazuhiko Shiozaki.

[#25461] Re: [Feature #2032] Change the license to "GPLv2+ or Ruby's original". — Gregory Brown <gregory.t.brown@...> 2009/09/07

On Fri, Sep 4, 2009 at 1:10 PM, Kazuhiko Shiozaki<redmine@ruby-lang.org> wrote:

[#25463] Re: [Feature #2032] Change the license to "GPLv2+ or Ruby's original". — Yukihiro Matsumoto <matz@...> 2009/09/08

Hi,

[#30610] [Feature #2032] Change the license to "GPLv2+ or Ruby's original". — Shyouhei Urabe <redmine@...> 2010/06/06

Issue #2032 has been updated by Shyouhei Urabe.

[#30611] Re: [Feature #2032] Change the license to "GPLv2+ or Ruby's original". — Yusuke ENDOH <mame@...> 2010/06/06

Hi,

[#30614] Re: [Feature #2032] Change the license to "GPLv2+ or Ruby's original". — Urabe Shyouhei <shyouhei@...> 2010/06/06

> To avoid enbugging a new bug, we must choose the another solutions.

[#30616] Re: [Feature #2032] Change the license to "GPLv2+ or Ruby's original". — Yusuke ENDOH <mame@...> 2010/06/06

2010/6/6 Urabe Shyouhei <shyouhei@ruby-lang.org>:

[#30652] Re: [Feature #2032] Change the license to "GPLv2+ or Ruby's original". — Urabe Shyouhei <shyouhei@...> 2010/06/08

(2010/06/06 20:27), Yusuke ENDOH wrote:

[#25285] [Feature #2033] Move Core Development to Git — Run Paint Run Run <redmine@...>

Feature #2033: Move Core Development to Git

75 messages 2009/09/02
[#25290] [Feature #2033] Move Core Development to Git — Yui NARUSE <redmine@...> 2009/09/02

Issue #2033 has been updated by Yui NARUSE.

[#25297] Re: [Feature #2033] Move Core Development to Git — Jon <jon.forums@...> 2009/09/02

> Some commiter of Ruby live on Windows.

[#25342] Re: [Feature #2033] Move Core Development to Git — Urabe Shyouhei <shyouhei@...> 2009/09/03

Jon wrote:

[#25343] Re: [Feature #2033] Move Core Development to Git — Michal Suchanek <hramrach@...> 2009/09/03

2009/9/4 Urabe Shyouhei <shyouhei@ruby-lang.org>:

[#25345] Re: [Feature #2033] Move Core Development to Git — Urabe Shyouhei <shyouhei@...> 2009/09/03

Michal Suchanek wrote:

[#25299] Re: [Feature #2033] Move Core Development to Git — Eric Hodel <drbrain@...7.net> 2009/09/02

On Sep 2, 2009, at 11:19, Run Paint Run Run wrote:

[#25306] [Feature #2034] Consider the ICU Library for Improving and Expanding Unicode Support — Run Paint Run Run <redmine@...>

Feature #2034: Consider the ICU Library for Improving and Expanding Unicode Support

16 messages 2009/09/03

[#25394] Unmaintained code (Was: Move Core Development to Git) — Eric Hodel <drbrain@...7.net>

On Sep 4, 2009, at 02:16, Urabe Shyouhei wrote:

10 messages 2009/09/05

[#25420] [Bug #2054] Onigurma Isn't Documented — Run Paint Run Run <redmine@...>

Bug #2054: Onigurma Isn't Documented

17 messages 2009/09/05

[#25442] turning off indentation warnings — Aaron Patterson <aaron@...>

Is there a way in 1.9 to turn off only indentation warnings? I like

19 messages 2009/09/06
[#25510] Re: turning off indentation warnings — Nobuyoshi Nakada <nobu@...> 2009/09/10

Hi,

[#25511] [Bug #2079] win32ole's OLEGEN does not create all classes needed when a TLB has more than one class defined — Bruno Antunes <redmine@...>

Bug #2079: win32ole's OLEGEN does not create all classes needed when a TLB has more than one class defined

18 messages 2009/09/10

[#25644] [Bug #2121] mathn/rational destroys Fixnum#/, Fixnum#quo and Bignum#/, Bignum#quo — Charles Nutter <redmine@...>

Bug #2121: mathn/rational destroys Fixnum#/, Fixnum#quo and Bignum#/, Bignum#quo

12 messages 2009/09/19

[#25709] [Bug #2131] f(not x) => syntax error — "James M. Lawrence" <redmine@...>

Bug #2131: f(not x) => syntax error

16 messages 2009/09/22

[#25769] A challenge: Enumerator#next in JRuby — Charles Oliver Nutter <headius@...>

I have a challenge for anyone who wants to discuss, propose

25 messages 2009/09/25
[#25782] Re: A challenge: Enumerator#next in JRuby — Tanaka Akira <akr@...> 2009/09/26

In article <f04d2210909251312q46bd51c0teacc4b0a8c417f0c@mail.gmail.com>,

[#25820] [Feature #2152] Split functionality of Float#inspect and Float#to_s — Roger Pack <redmine@...>

Feature #2152: Split functionality of Float#inspect and Float#to_s

32 messages 2009/09/28

[#25853] [Bug #2160] JSON can't parse input where top-level object is a string — caleb clausen <redmine@...>

Bug #2160: JSON can't parse input where top-level object is a string

11 messages 2009/09/29

[ruby-core:25786] Re: A challenge: Enumerator#next in JRuby

From: Charles Oliver Nutter <headius@...>
Date: 2009-09-26 05:08:44 UTC
List: ruby-core #25786
On Fri, Sep 25, 2009 at 8:57 PM, Tanaka Akira <akr@fsij.org> wrote:
> I thought this slowness sometimes ago.
>
> STDIN.lines.next
> is basically same as
> STDIN.gets or raise StopIteration
> but it has overhead of Fiber.
>
> IO has already a method for external iteration method (gets)
> but IO#lines cannot use it.
>
> I think Enumerator.new (and possibly to_enum, enum_for)
> should be able to take an array consists of two method names
> for internal and external iteration as:
> =C2=A0Enumerator.new(obj, [method1, method2], *args)
> method1 is for internal iteration and method2 is for
> external iteration. =C2=A0The enumerator created by
> Enumerator.new uses method2 when next method is called if
> method2 is provided. =C2=A0obj.method2 should return an object
> for external iteration.

Yes, this is along the lines of what Evan Phoenix and I
discussed...providing a way to opt out of Fiber/Generator-based
external iteration.

I like your ideas...more below.

> If Enumerator.new provides such way to avoid Fiber, IO can
> use it as:
>
> class IO
> =C2=A0def lines
> =C2=A0 =C2=A0Enumerator.new self, [:each_line, :external_iterator_for_lin=
es]
> =C2=A0end
>
> =C2=A0def to_enum(meth=3D:each, *args)
> =C2=A0 =C2=A0if meth =3D=3D :each || meth =3D=3D :each_line
> =C2=A0 =C2=A0 =C2=A0super [:each_line, :external_iterator_for_lines], *ar=
gs
> =C2=A0 =C2=A0else
> =C2=A0 =C2=A0 =C2=A0super
> =C2=A0 =C2=A0end
> =C2=A0end

So if doing internal iteration, the first method (each_line) will be
called with a block. If doing external iteration, the second method
(external_iterator_for_lines) will be called to produce an Enumerator
that knows how to do a lightweight external iteration of lines.

>  def external_iterator_for_lines
>    o =3D Object.new
>    o.instance_variable_set(:@io, self)
>    def o.next
>      @io.gets or raise StopIteration
>    end
>    o
>  end
> end

I guess there would be an analog you could use in custom #each
implementations...

def each
  if block_given?
    normal each logic
  else
    Enumerator.new(self, [:each, :each_external])
  end
end

Yes, this is definitely a step in the right direction. But I wonder if
allowing people to do arbitrarily complex external iteration is worth
it? It's going to be slow as long as switching stacks is slow, and
it's always going to be a heavy operation on platforms where
stack-juggling isn't permitted (or is too hard to bother trying).

External enumeration is a feature Ruby should have;
arbitrarily-complex continuation-driven external iteration is more of
a problem than a solution.

>
> This idea may solve some part of JRuby problem if a class
> provides custom to_enum. =C2=A0If a class don't provide that or
> user specify unexpected method name for to_enum, it still
> problem though.

I think it's a problem for any implementation since the performance
characteristics of a continuation-based #next are atrocious. And yet
there it is, luring you to use it, even though it's slow on 1.8.7 and
1.9 and spins up a whole native thread on JRuby (and eventually on
IronRuby and maybe others).

And so it's still clear...I think external enumeration is a great
feature, but I think there should be a clearly-defined protocol for
opting *in* to Enumerator#next, not a protocol to have to follow to
opt *out* of poor performance or heavyweight enumerators as in JRuby.
Put simply, I think collections should be required to *choose* to use
a fiber to implement external iteration, rather than using fibers
automatically.

So I'm thinking that if you implement "each" but not your own
"enum_for" or "to_enum", #next shouldn't work. You can then choose to
implement it with a fiber or not.

(but at the very least we need a clearly-defined protocol for opting
out, since I suspect *most* users of external iteration will *have to*
opt out to get reasonable performance)

- Charlie

In This Thread