TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ruby 2.7

336 pointsby sadiqmmmover 5 years ago

10 comments

seanmccannover 5 years ago
I had wondered why most recent Ruby releases were on Christmas Day and recently found out why. The Ruby creator Matz is religious (LDS), and he considers it a Christmas gift to the community. I thought that was really cool.
ufoover 5 years ago
One of the interesting news is that they are now going to start requiring a C99 compiler, instead of only C90.<p>I&#x27;ve been considering to do the same on my own projects. What does HN have to say about this? Is anyone here still working in a context where C99 is not an option? Did anyone else also recently switch to C99? How did it go?
评论 #21879894 未加载
评论 #21879248 未加载
评论 #21879206 未加载
burlesonaover 5 years ago
&gt; Calling a private method with a literal self as the receiver is now allowed.<p>Oof. Call me old fashioned, but I liked the consistency of not being able to call private methods with an explicit receiver. Oh well!<p>The rest of this looks great, thanks Ruby team!
评论 #21880338 未加载
faitswulffover 5 years ago
I know it&#x27;s slow at the moment, but is anyone planning on using pattern matching for anything in particular? Curious what use cases are particularly suitable for it.
评论 #21878359 未加载
sergiotapiaover 5 years ago
Pattern matching is awesome in Elixir, it&#x27;s great to see functional language traits stain the Ruby language more. It&#x27;s all the better for it.
评论 #21878883 未加载
评论 #21879051 未加载
评论 #21878965 未加载
z92over 5 years ago
The compaction GC was the most important change. I haven&#x27;t measured Ruby&#x27;s performance specifically but in general the difference and improvements over a non-compacting GC is so huge. Specially for long running processes.
评论 #21879749 未加载
评论 #21879664 未加载
mattmarcusover 5 years ago
I&#x27;m most excited for <i>Enumerable#tally</i> for counting occurrences of elements.<p>From the example in the release:<p><pre><code> [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;b&quot;].tally #=&gt; {&quot;a&quot;=&gt;1, &quot;b&quot;=&gt;2, &quot;c&quot;=&gt;1} </code></pre> There&#x27;s more about this change here (<a href="https:&#x2F;&#x2F;medium.com&#x2F;@baweaver&#x2F;ruby-2-7-enumerable-tally-a706a5fb11ea" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;@baweaver&#x2F;ruby-2-7-enumerable-tally-a706a...</a>). I probably do this a few times a week:<p><pre><code> list.each_with_object(Hash.new(0)) { |v, h| h[v.something] += 1 }</code></pre>
评论 #21880702 未加载
评论 #21881772 未加载
tyingqover 5 years ago
Does the pattern matching do something that Ruby&#x27;s map() can&#x27;t do?<p>Coming from Perl, map() there can return fewer elements than the source list, so pattern matching works already. A short skim of Ruby&#x27;s map seems to imply it always returns something with the same number of elements.<p>Edit: I was confused about what this feature did. So this subthread is still interesting, but mostly unrelated.
评论 #21878562 未加载
评论 #21878657 未加载
claudiugover 5 years ago
great! i truly like this language.
评论 #21878611 未加载
atraktorover 5 years ago
Love Matz &amp; Ruby, Merry Christmas!