
Ruby 2.1.0 preview1 released - obilgic
https://www.ruby-forum.com/topic/4417257
======
saidajigumi
I really wish that Ruby had an actual _language_ reference instead of just the
core and stdlib docs. If those same docs were versioned and updated along with
the code, then changes in the language would have docs changes that could be
linked together into a "What's New" section. Decent basic tutorial material
wouldn't hurt either.

This is an area where so many other languages like Python[1], Go[2], etc. get
it right. The only semblance of an online language reference is a version of
the Pickaxe book that was already out of date back when Rails was a screaming
v1.0 newborn.

[1] Python language ref:
[http://docs.python.org/3/reference/index.html](http://docs.python.org/3/reference/index.html)

[2] Go language ref: [http://golang.org/ref/spec](http://golang.org/ref/spec)

~~~
steveklabnik
There is an ISO standard for 1.8.7 and RubySpec for all versions.

~~~
VeejayRampay
Though 1.8.7 was released more than 5 years ago (and the language has evolved
a lot since then) and the RubySpec are usually not up to date, at least not
documenting all the features as they come in (as Brian Ford and others have
pointed out several times).

Not to be an ungrateful d*ck, I think the progress made is fantastic and
supported by a bunch of extremely dedicated, talented and courageous people,
but there is something of a void in terms of Ruby-as-formally-specified-
language, hard to deny. But as usual, I guess it's hard to find the manpower,
the time and the money to support such efforts.

~~~
steveklabnik
Yup. I totally agree with you, a formal spec would be great. But it's not in
the cards, so we do the best with what we've got.

------
MartinMond
So what happened to refinements? They were given a warning in 2.0 because the
other implementations warned that implementing refinements would lead to worse
performance. Has that been fixed?

~~~
MartinMond
@headius was so kind to answer my question on Twitter:
[https://twitter.com/MSch/status/382065119515398144](https://twitter.com/MSch/status/382065119515398144)

------
twelvechairs
I'm still waiting (4 years now) for method#to_source. _sigh_

[http://bugs.ruby-lang.org/issues/2080](http://bugs.ruby-lang.org/issues/2080)

~~~
transfire
Ha! I have you beat! I've been waiting 7 years for to be able override
autoload's require.

[https://bugs.ruby-lang.org/issues/7716](https://bugs.ruby-
lang.org/issues/7716)

In fact, after 10 years of dedication, b/c of this and a few other issues (and
attitudes) I don't use Ruby any more.

~~~
lectrick
Autoload is fundamentally broken because it makes your app state
nondeterministic by making state loading and logic interdependent.

I work on a large Ruby software project and we've had to move away from any
autoload except for very specific cases for this reason- troubleshooting
autoload bugs are the WORST.

Maybe this is the reason it hasn't been looked at.

~~~
transfire
I wish. There was a window of time when Matz said autoload would be
deprecated. But he took that back after Yahuda (I think) addressed some
threading issue. I agree with your assessment, but too many big names project
use it --RubyGems, Psych, Rails, etc.

I wrote my one load system but have never been able to use it 100% with other
projects b/c I could not override autoload require. Though I've begged for
years Matz just keeps blowing it off.

------
ksec
Time for some Benchmarks. Ruby 2.1, JRuby 1.7.5 and the Duke Nukeum Rubinius
2.0.

------
drakaal
Non-Blocking IO with out raising an exception is a notable new feature. The
Improvements to Garbage Collection is also pretty huge.

The 128bit number support is cool, I mean if you want to work with Quadruple-
precision floating-point numbers... I know I do.

~~~
topac
Where do you find out about the non-blocking io?

~~~
MrBra
I suppose he refers to this...

* IO
    
    
      * extended methods:
    
        * IO#seek supports SEEK_DATA and SEEK_HOLE as whence.
    
        * IO#seek accepts symbols (:CUR, :END, :SET, :DATA, :HOLE) for 2nd argument.
    
        * IO#read_nonblock accepts optional `exception: false` to return symbols
    
        * IO#write_nonblock accepts optional `exception: false` to return symbols
    

see
[https://github.com/ruby/ruby/blob/v2_1_0_preview1/NEWS](https://github.com/ruby/ruby/blob/v2_1_0_preview1/NEWS)

------
saurabhnanda
Wasn't there an overwhelming _negative_ feedback for refinements? What was the
rationale for still going ahead with them?

~~~
regularfry
Matz has said we're getting them, so we're getting them.

~~~
saurabhnanda
Sure, he's the benevolent dictator (and the creator of language, itself), but
he would've explained himself somewhere. About the benefits of refinements and
how to deal with the downsides. Any links?

~~~
regularfry
If you've got the patience, [https://bugs.ruby-
lang.org/issues/4085#note-95](https://bugs.ruby-lang.org/issues/4085#note-95)
is the ruby-core discussion. It really does boil down to "Matz says so."

------
singularity2001
List of new features: [http://bugs.ruby-lang.org/projects/ruby-
trunk/issues?set_fil...](http://bugs.ruby-lang.org/projects/ruby-
trunk/issues?set_filter=1&f%5B%5D=status_id&op%5Bstatus_id%5D=c&f%5B%5D=tracker_id&op%5Btracker_id%5D=%3D&v%5Btracker_id%5D%5B%5D=2&f%5B%5D=fixed_version_id&op%5Bfixed_version_id%5D=%3D&v%5Bfixed_version_id%5D%5B%5D=27&f%5B%5D=&c%5B%5D=tracker&c%5B%5D=status&c%5B%5D=priority&c%5B%5D=subject&c%5B%5D=assigned_to&c%5B%5D=updated_on&group_by=)

------
forlorn
Is there more detailed changes description?

~~~
forlorn
Closed tickets in bugtracker:

[http://bugs.ruby-lang.org/projects/ruby-
trunk/issues?set_fil...](http://bugs.ruby-lang.org/projects/ruby-
trunk/issues?set_filter=1&f%5B%5D=status_id&op%5Bstatus_id%5D=c&f%5B%5D=fixed_version_id&op%5Bfixed_version_id%5D=%3D&v%5Bfixed_version_id%5D%5B%5D=27&f%5B%5D=&c%5B%5D=tracker&c%5B%5D=status&c%5B%5D=priority&c%5B%5D=subject&c%5B%5D=assigned_to&c%5B%5D=updated_on&group_by=)

------
jeltz
A list of language and library changes in this release. It does not include
some things like the GC and method cache changes.

[https://github.com/ruby/ruby/blob/v2_1_0_preview1/NEWS](https://github.com/ruby/ruby/blob/v2_1_0_preview1/NEWS)

------
mmanfrin
From the link:

The notable changes are:

* VM (method cache)

* RGenGC

* refinements

* syntax

* Decimal Literal

* Frozen String Literal

* def's return value

* Bignum

* 128bit

* GMP

* String#scrub

* Socket.getifaddrs

* new Rubygem

~~~
riffraff
I think def's return value means returning symbol rather than nil? I've been
waiting for it for ten years, I had almost forgotten why I wanted it in the
first place :)

~~~
_anshulk
So, this would mean that

private def foo

end

will now work?

~~~
transfire
Yes. And it is somewhat surprising. Matz must have rejected this idea a dozen
times. It was certainly one of the oldest feature requests around. Hard to
imagine what must have changed his mind. I've rarely seem Matz change his
mind.

~~~
riffraff
I seem to recall the issue was more with returning UnboundMethod objects than
with symbols, but possibly what's changed is the fact that now symbols can be
GCed?

