[#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:32645] Re: Proposal for Optional Static Typing for Ruby

From: Rick DeNatale <rick.denatale@...>
Date: 2010-09-29 22:53:56 UTC
List: ruby-core #32645
On Wed, Sep 29, 2010 at 3:40 PM, Charles Oliver Nutter
<headius@headius.com> wrote:
> On Wed, Sep 29, 2010 at 8:03 AM, Bill Kelly <billk@cts.com> wrote:
>> As an aside -- it's been pointed out to me on occasion that
>> dynamic languages don't theoretically have to be slow; that one
>> could conceivably perform sophisticated run-time analysis and
>> optimize certain dynamic code paths to native instructions.
>>
>> But in practical terms, if types are known at compile time,
>> generation of efficient native code is a well understood
>> problem.
>
> This is the crux of the problem. Ruby is dynamic to a great enough
> extent that global optimization is not always possible (or at least
> not feasible) since anything, anywhere in the system can change. Not
> only can new types be introduced, but existing types can be modified,
> and even individual objects only give soft guarantees about what type
> they are (singletonizing an object is almost a limited "become" from
> Smalltalk, and defeats most dynamic optimizations completely).
>
> And the unfortunate truth is that those features which make Ruby hard
> to optimize are also some of the nicest features. I use them myself,
> knowing that no implementation can cope with them perfectly.

This is more my decision as to where to jump into this discussion, and
not really a reply to Charles, but his comment here seems a useful
place to hang my two cents.

There are (at least) two ideas playing around in this thread.  One is
the desire to somehow use types to make a program written in a
dynamically run-time typed language like ruby, the other is to use
type information to improve the performance of programs written in
such languages.

The first idea seems most popular among those coming to a dynamically
typed language from a language like C++ or Java which expresses types
via class/interface hierarchies or DAGs.  Since both Ruby and C++ are
"object oriented" what's good for one must be good for another.  The
truth is that there are two very different notions of what "object
oriented" means which confuses discussions. I won't go into that too
much here, but I'll cover it at length in my upcoming talk at Ruby
Conf.

Both ideas have a long history, which is somewhat intertwined. I can
give a bit of a Smalltalk oriented perspective.  Several folks worked
on project to add type declarations to Smalltalk in the late 1980s
early 1998s. Some of these were experienced Smalltalkers who knew the
power of dynamic typing, folks like Dan Ingalls (the original
implementor of Smalltalk from it's inception through Smalltalk-80) and
who went on to later be one of the driving forces behind Squeak. Alan
Borning of UW, and Ralph Johnson of UI-UC.  Another effort was a
project code named Woody at Knowledge Systems Corp here in the
Triangle area, led by Steve Burbeck and Sam Adams who had considerable
Smalltalk implementation and usage background.

Most of these efforts eventually stalled out, probably because of a
realization of the difficulties of adding an expressive enough
'statlc' type system, even as an optional annotation to a language
like Smalltalk.

Not that the work was completely fruitless. Ralph also led his
graduate students to build the first (semi) automatic refactoring
tools, using the Smalltalk development environment.  One of the
complaints about modern-day dynamically typed languages is that they
don't tend to have such refactoring tools.  Such tools are a bit easer
in a language like Java where type-checking can help drive the
refactorings. In the early days of VisualAge for Java (the precursor
to today's Eclipse), there was crude refactoring support from having
changes which caused type violations turn on little red x's on the
classes affected, giving a kind of to-do list for manually refactoring
something. Of course today's Java IDE are more like Ralph's original
Smalltalk refactory.

And as my one of my friends and personal heroes, Ward Cunningham, has
been heard to say, "It's a good thing that Java has good refactoring
tools, because you have to do a lot more of it."  In a dynamically
typed language you aren't forced to immediately change things just to
keep the type system in line.  Instead you can proceed faster and
refactor somewhat more infrequently to pay off technical debt.  Using
Test Driven development is a much more flexible and pleasant work flow
for those of us who have gotten used to the dynamically typed
philosophy.

And Ruby inherited a lot of the same blessings and curses of the
Smalltalk view of computation via objects, rather than objects as
abstract data types.  What it lacks is the kind of development
environment that Smalltalk has on the whole I can live without the ide
though.

On he performance side, there's been a long history of utilizing type
information, either heuristically 'hard coded' or gathered at run-time
to improve performance.

In the vein of "heuristic hardcoding" early Smalltalk implementations
(and maybe most if not all current ones) do things like cheating on
the implementation of control flow.  In Smalltalk if 'statements' are
implemented as message sends to boolean objects which selectively then
evaluate a block argument corresponding to whether the receiver is
true or false.  In most implementations this was implemented as a test
and branch rather than a message send, with some treating a
non-boolean 'receiver' on an exception basis.  Another example was
assuming that most "+" messages are sent with a SmallInteger
(Smalltalks equivalent to FixNum) with a SmallInteger argument.  So +
gets implemented as simply adding the two object references together,
and detecting whether or not the result is still a SmallInteger after
a bit of bit manipulation.  If it is you're done, if not you do the
actual message send.

A careful selection of the representation of a SmallInteger can make
it easy to do this with a bit of bit manipulation.  For example, if
you take an MRI style VALUE as a machine integer, I think if you xor
one of the two arguments with 1 and add, then if the resulting integer
is odd and you haven't generated an overflow, then you know that both
the arguments and the result are FixNums.  This might not be exactly
correct for Ruby's representation, but most Smalltalk's picked an
implementation which allowed such tricks.

Another family of tricks was caching method lookups either globally or
at the call site, with clever techniques to detect and react to a
cache miss. Terms like Polymorphic Inline Cache came into being.

Such trickiness disturbed some Smalltalkers, in particular David
Ungar, who had done his PhD dissertation at UC Berkeley on the
measurement and improvement of Berkeley's Smalltalk implementation,
decided to try to take tricks like hard compiling ifTrue:ifFalse: and
make a language like Smalltalk, but even more dynamic, the result was
Self, which has features like removing the distinction between
instance variable and methods, both are simply named slots looked up
dynamically, the difference being that a method slot is marked so that
instead of returning it's contents, it evaluates it.  Self also did
away with explicit classes let alone class inheritance, instead it
used a prototype based scheme similar to that 'built in' to JavaScript
these days.

Then Dave and his Self guys worked to get the performance back by
gathering on-the-fly information about 'types' and generating
optimized code again into a cache so that it could be flushed and
recomputed as facts on the ground changed.

The work on Self eventually fed into the Java Hotspot VM.

-- 
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Github: http://github.com/rubyredrick
Twitter: @RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

In This Thread