[#32009] merging nokogiri to ext/ — Aaron Patterson <aaron@...>

I would like to merge nokogiri to ext for the 1.9.3 release. I spoke to

82 messages 2010/09/02
[#32010] Re: merging nokogiri to ext/ — "U.Nakamura" <usa@...> 2010/09/02

Hello,

[#32012] Re: merging nokogiri to ext/ — Ryan Davis <ryand-ruby@...> 2010/09/02

[#32030] Re: merging nokogiri to ext/ — "NARUSE, Yui" <naruse@...> 2010/09/03

Hi,

[#32033] Re: merging nokogiri to ext/ — "NARUSE, Yui" <naruse@...> 2010/09/03

2010/9/3 NARUSE, Yui <naruse@airemix.jp>:

[#32155] Re: merging nokogiri to ext/ — Yusuke ENDOH <mame@...> 2010/09/08

Currently, we're discussing three different topics:

[#32189] Re: merging nokogiri to ext/ — Aaron Patterson <aaron@...> 2010/09/09

On Thu, Sep 09, 2010 at 01:40:34AM +0900, Yusuke ENDOH wrote:

[#32056] [Ruby 1.8-Bug#3788][Open] URI cannot parse IPv6 addresses propertly — Adam Majer <redmine@...>

Bug #3788: URI cannot parse IPv6 addresses propertly

16 messages 2010/09/04

[#32110] Ruby 2.0 Wiki/Wish-list? — Joshua Ballanco <jballanc@...>

Hi all,

41 messages 2010/09/07
[#32114] Re: Ruby 2.0 Wiki/Wish-list? — "NARUSE, Yui" <naruse@...> 2010/09/08

2010/9/8 Joshua Ballanco <jballanc@gmail.com>:

[#32117] Re: Ruby 2.0 Wiki/Wish-list? — Joshua Ballanco <jballanc@...> 2010/09/08

On Sep 7, 2010, at 5:21 PM, NARUSE, Yui wrote:

[#32143] Re: Ruby 2.0 Wiki/Wish-list? — Roger Pack <rogerdpack2@...> 2010/09/08

> So, for example, a few things I've wanted for a long time:

[#32135] [Ruby-Bug#3802][Open] freeaddrinfo not found in WS2_32.dll — Thomas Volkmar Worm <redmine@...>

Bug #3802: freeaddrinfo not found in WS2_32.dll

16 messages 2010/09/08

[#32154] Making custom_lambda() work — Magnus Holm <judofyr@...>

A tiny suggestion for how we could make it possible to call lambdas

15 messages 2010/09/08
[#32159] Re: Making custom_lambda() work — Nikolai Weibull <now@...> 2010/09/08

On Wed, Sep 8, 2010 at 18:21, Magnus Holm <judofyr@gmail.com> wrote:

[#32156] Can we convert the standard library to gems? — James Edward Gray II <james@...>

Taken from the bundle Nokogiri thread:

98 messages 2010/09/08
[#32161] Re: Can we convert the standard library to gems? — Marcus Rueckert <darix@...> 2010/09/08

On 2010-09-09 01:45:43 +0900, James Edward Gray II wrote:

[#32166] Re: Can we convert the standard library to gems? — James Edward Gray II <james@...> 2010/09/08

On Sep 8, 2010, at 12:03 PM, Marcus Rueckert wrote:

[#32173] Re: Can we convert the standard library to gems? — Marcus Rueckert <darix@...> 2010/09/08

On 2010-09-09 02:54:26 +0900, James Edward Gray II wrote:

[#32249] Re: Can we convert the standard library to gems? — Aaron Patterson <aaron@...> 2010/09/09

On Thu, Sep 09, 2010 at 05:26:54AM +0900, Marcus Rueckert wrote:

[#32278] Re: Can we convert the standard library to gems? — Lucas Nussbaum <lucas@...> 2010/09/10

On 10/09/10 at 02:41 +0900, Aaron Patterson wrote:

[#32162] Re: Can we convert the standard library to gems? — Yusuke ENDOH <mame@...> 2010/09/08

Hi,

[#32216] Re: Can we convert the standard library to gems? — Ryan Davis <ryand-ruby@...> 2010/09/09

[#32229] Re: Can we convert the standard library to gems? — Yusuke ENDOH <mame@...> 2010/09/09

Hi,

[#32260] Re: Can we convert the standard library to gems? — Ryan Davis <ryand-ruby@...> 2010/09/09

[#32275] Re: Can we convert the standard library to gems? — Urabe Shyouhei <shyouhei@...> 2010/09/10

I'm off today so sorry if I missed some mails.

[#32293] Re: Can we convert the standard library to gems? — James Cox <james@...> 2010/09/10

Urabe,

[#32316] Re: Can we convert the standard library to gems? — Urabe Shyouhei <shyouhei@...> 2010/09/11

(2010/09/10 23:48), James Cox wrote:

[#32322] Re: Can we convert the standard library to gems? — James Tucker <jftucker@...> 2010/09/11

[#32335] Re: Can we convert the standard library to gems? — Urabe Shyouhei <shyouhei@...> 2010/09/12

I'm at an airport back to my home so in short,

[#32343] Re: Can we convert the standard library to gems? — James Cox <james@...> 2010/09/12

On Sun, Sep 12, 2010 at 6:51 AM, Urabe Shyouhei <shyouhei@ruby-lang.org> wr=

[#32382] Re: Can we convert the standard library to gems? — Urabe Shyouhei <shyouhei@...> 2010/09/14

(2010/09/13 3:54), James Cox wrote:

[#32383] Re: Can we convert the standard library to gems? — James Cox <james@...> 2010/09/14

On Tue, Sep 14, 2010 at 12:37 PM, Urabe Shyouhei <shyouhei@ruby-lang.org> wrote:

[#32393] Re: Can we convert the standard library to gems? — Urabe Shyouhei <shyouhei@...> 2010/09/15

How difficult to make myself understood in English.

[#32396] Re: Can we convert the standard library to gems? — James Cox <james@...> 2010/09/15

On Wed, Sep 15, 2010 at 1:43 AM, Urabe Shyouhei <shyouhei@ruby-lang.org> wr=

[#32399] Re: Can we convert the standard library to gems? — Yusuke ENDOH <mame@...> 2010/09/15

Hi,

[#32400] Re: Can we convert the standard library to gems? — James Cox <james@...> 2010/09/15

On Wed, Sep 15, 2010 at 12:07 PM, Yusuke ENDOH <mame@tsg.ne.jp> wrote:

[#32401] Re: Can we convert the standard library to gems? — Marcus Rueckert <darix@...> 2010/09/15

On 2010-09-16 01:42:39 +0900, James Cox wrote:

[#32402] Re: Can we convert the standard library to gems? — James Cox <james@...> 2010/09/15

On Wed, Sep 15, 2010 at 1:35 PM, Marcus Rueckert <darix@opensu.se> wrote:

[#32411] Re: Can we convert the standard library to gems? — Marcus Rueckert <darix@...> 2010/09/15

On 2010-09-16 03:36:56 +0900, James Cox wrote:

[#32412] Re: Can we convert the standard library to gems? — James Cox <james@...> 2010/09/16

On Wednesday, September 15, 2010, Marcus Rueckert <darix@opensu.se> wrote:

[#32414] Re: Can we convert the standard library to gems? — Lucas Nussbaum <lucas@...> 2010/09/16

On 16/09/10 at 11:02 +0900, James Cox wrote:

[#32248] Replacing stdlib Date with C version — Jeremy Evans <code@...>

I've recently been working on a replacement for the stdlib Date class,

15 messages 2010/09/09

[#32290] [Ruby 1.9.2-Backport#3818][Open] Seg fault with ruby tmail and ruby 1.9.2 — Karl Baum <redmine@...>

Backport #3818: Seg fault with ruby tmail and ruby 1.9.2

10 messages 2010/09/10

[#32453] Why doesn’t Enumerable define a #last method? — Nikolai Weibull <now@...>

Hi!

9 messages 2010/09/17

[#32454] [Ruby 1.9-Feature#3845][Open] "in" infix operator — Yusuke Endoh <redmine@...>

Feature #3845: "in" infix operator

20 messages 2010/09/17
[#32489] Re: [Ruby 1.9-Feature#3845][Open] "in" infix operator — Benoit Daloze <eregontp@...> 2010/09/21

On 17 September 2010 12:30, Yusuke Endoh <redmine@ruby-lang.org> wrote:

[#32529] [Ruby 1.9-Bug#3869][Open] Logger#log does not handle or escape new-line characters. — Hal Brodigan <redmine@...>

Bug #3869: Logger#log does not handle or escape new-line characters.

9 messages 2010/09/23

[#32585] Proposal for Optional Static Typing for Ruby — Martin Pilkington <pilky@...>

Hi,

47 messages 2010/09/27
[#32588] Re: Proposal for Optional Static Typing for Ruby — Yukihiro Matsumoto <matz@...> 2010/09/27

Hi,

[#32592] Re: Proposal for Optional Static Typing for Ruby — Martin Pilkington <pilky@...> 2010/09/28

Hi Matz

[#32595] Re: Proposal for Optional Static Typing for Ruby — Asher <asher@...> 2010/09/28

Martin,

[#32611] Re: Proposal for Optional Static Typing for Ruby — Loren Segal <lsegal@...> 2010/09/28

Hi,

[#32628] Re: Proposal for Optional Static Typing for Ruby — Eleanor McHugh <eleanor@...> 2010/09/29

It strikes me that much of the premise behind this thread is misguided =

[#32634] [Ruby 1.9-Bug#3889][Open] Incorrectly detected i686-w64-mingw32 as x64-mingw — Luis Lavena <redmine@...>

Bug #3889: Incorrectly detected i686-w64-mingw32 as x64-mingw

21 messages 2010/09/29

[ruby-core:32632] Re: Proposal for Optional Static Typing for Ruby

From: Loren Segal <lsegal@...>
Date: 2010-09-29 15:32:52 UTC
List: ruby-core #32632
  Hi Joshua,

On 9/28/2010 10:36 PM, Joshua Ballanco wrote:
> I intended no offense via omission in not quoting your next example. I merely wanted to point out that testing against a specific class is not a very good paradigm to follow. I realize that an awful lot of Ruby code that you might find today includes just this sort of anti-patern, but I don't think that is a legitimate excuse. I think it's a symptom of poor design.
Poor design can be a valid argument. However, it's hard to define whose 
design is the "poor" one when we're talking about a multi-paradigm 
language. A duck-typed system is not always the "right" design just 
because the target language is Ruby. There are many cases of good design 
in Ruby that use perfectly standard class-based systems with very little 
duck-typing-- I don't think it's fair to call them poor just because 
they don't use duck-types.
> In this specific case, I would argue that a #run method which either takes a pre-constructed object *or* parameters to construct the object for you is not very well designed. These are two different tasks. The should be handled by two different methods. I realize that this is, essentially, what you're proposing with annotating the argument types, but I wonder why you think that annotating types is better than just creating two different methods with different names?

Using a separate name is not always viable, and, in fact, often yields 
messy APIs. The benefits of reusing a common name is that you have fewer 
"verbs" to deal with, and your API "Just Works" for the given input. 
Overloading is a pretty common idiom in many languages, especially Ruby. 
Just about every Ruby API (including Ruby's own core APIs) does this, so 
let me pre-empt you by saying it's not "poor design" to do this. The 
only difference is that in Ruby, it's all handled manually by the 
programmer, and the only reason this is so is because the interpreter 
could not distinguish method definitions without the type information.

But let me answer your question more directly by offering you a better 
example, one straight out of ruby-core's libraries. Consider String#[] 
(http://ruby-doc.org/core-1.8.7/classes/String.html#M000700), aka. 
String#slice, which has a whole host of overloads, 6 of them to be 
exact. This method would be a perfect candidate for actual overloading 
support. Do you think String#slice should be split up into #slice_index, 
#slice_range, #slice_regexp, etc.? I wouldn't think that would be a good 
API design.

> Object-oriented != Class-oriented
>
> If you're requiring specific classes, then you're not truly duck-typed. To be clear, I'm not attempting to make any judgement about doing things one way or the other, but I think we must be very clear about what it is that we are trying to accomplish. If you want a class-based type system, say so! But this is not the same thing as a duck type system.

Why do we have to choose? Why do we *have* to use duck typing? Ruby 
allows us both. The point here is that type annotations could allow 
either or neither, but also improve the way which we do some regular 
everyday things. I'm not trying to make Ruby less dynamic, or less 
duck-typed-- that part should be made clear. I'm simply trying to point 
out that type annotations could be used to simplify many existing and 
widely used idioms. Whether they're valid idioms is a discussion for 
another thread, IMO.
> The reason that I didn't pick on your second example with the method requirement is that I feel like this is better handled in a formal design-by-contract syntax than as a type-signature, but that's an opinion.
The way I see it, these type annotations *are* a DbC syntax. Why do you 
see it as otherwise?

> The more fundamental issue that we still haven't addressed is that when you say:
>
> 	def run(thing: #start)
> 	  thing.start
> 	end
>
> You're making the implicit assumption that #start will always do what you expect. What makes Ruby difficult is not the lack of type annotations or class-based vs duck typed, it's the fact that the duck-typing is unreliable! Depending on what's going on in code you 'require', you have no idea if String#length will do what you expect, or that 'require' itself hasn't been redefined.
Weren't you just all about the duck-typing, and now you're calling them 
unreliable and difficult? :) In any case, I don't think that's very 
relevant. It doesn't matter "what" #start will do, the type information 
here simply says that it should respond to a method, any method, named 
#start. It wouldn't be the goal of a duck-type-based annotation to 
actually *statically* type anything. The type annotation would exist for 
documentative purposes, but could also be used by the compiler at 
run-time, or by tooling for some data-flow analysis.

Perhaps there's a misunderstanding of the proposal here, or at least 
mine. It would be impossible to have a fully statically typed Ruby 
program if type information is only provided optionally unless *all* 
types were defined; but let's be realistic, that won't happen. 
Therefore, this isn't *really* static typing, it's simply type 
annotations. I would see this being used, as I just said, at run-time or 
by tools-- very rarely, if ever, at compile-time-- at least certainly 
not if duck-typed annotations were used. I'm not too sure if that's what 
was originally intended to be proposed by this thread, but that's how I 
would see it.

- Loren

In This Thread