TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ruby 3.1

501 点作者 sebiw超过 3 年前

16 条评论

burlesona超过 3 年前
Ruby now has “punning.”<p>&gt; Values in Hash literals and keyword arguments can be omitted. [Feature #14579]<p>&gt; {x:, y:} is a syntax sugar of {x: x, y: y}.<p>&gt; foo(x:, y:) is a syntax sugar of foo(x: x, y: y).<p>This is going to be controversial and take some getting used to, but I think eventually everyone will love it. It’s not an easy syntax to learn - I remember when this came to JS it took a while to get my head around all the different ways this shorthand was used in the wild.<p>It’s hard to come up with new syntax that can peacefully coexist with the established language. I think in hindsight it would have been helpful for Ruby if it had done something like square braces instead of brackets for hash literals, or not allowed brackets for blocks. The most ambiguous syntax all involves hash literals vs blocks… this adds to that cognitive load.<p>But typing out a long hash literal just to capture a bunch of local variables or methods is so common, and the duplication is quite annoying, so on the whole I’m glad this was added and am sure I’ll use it a lot :)
评论 #29684993 未加载
评论 #29686628 未加载
评论 #29686345 未加载
评论 #29683944 未加载
评论 #29686369 未加载
评论 #29688698 未加载
评论 #29687392 未加载
评论 #29684844 未加载
sandstrom超过 3 年前
&quot;The following default gems are now bundled gems.&quot; Great to see slow removal (or carve out) of rarely used stdlib stuff.<p>Ruby would benefit from a trimmed down stdlib, where effort could be spent keeping a smaller footprint stdlib more polished than it is today. Turning them into opt-in gems is a good first step.<p>A few examples:<p>- `rss` to parse RSS documents&#x2F;streams<p>- `win32ole` for Microsoft Windows OLE Automation<p>- `dbm` for DBM databases<p>- `abbrev` for finding the shortest unique abbreviation amongst many strings<p>This page has more details: <a href="https:&#x2F;&#x2F;stdgems.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;stdgems.org&#x2F;</a>
评论 #29683953 未加载
评论 #29684039 未加载
评论 #29687088 未加载
purple_ferret超过 3 年前
Love Ruby. Personal language of choice. People keep predicting its death, but it just keeps getting better and better!
评论 #29685375 未加载
dwheeler超过 3 年前
Related: I believe there is ongoing work (not in 3.1) to modify the CRuby implementation to use shapes&#x2F;hidden classes. This has significant potential to speed things up. More info: <a href="https:&#x2F;&#x2F;chrisseaton.com&#x2F;truffleruby&#x2F;rubykaigi21&#x2F;" rel="nofollow">https:&#x2F;&#x2F;chrisseaton.com&#x2F;truffleruby&#x2F;rubykaigi21&#x2F;</a>
gouda-gouda超过 3 年前
Thank you Matz and team! Lot of awesome stuff in this release.
geospeck超过 3 年前
No news about Ractors! The new concurrency facilities that Ruby 3.0 introduced. Anyone has an insight if there was any further development on that front?
评论 #29684733 未加载
评论 #29686704 未加载
ksec超过 3 年前
I thought TypeProf is really interesting but doesn&#x27;t seems to get much attention.<p>I am also wondering if anyone is using RBS in production. Apart from big shops like Stripe &#x2F; Shopify.
评论 #29684888 未加载
dysoco超过 3 年前
What a coincidence, I just started learning a bit of Ruby with an interpreter I&#x27;m writing a couple of nights ago.<p>I will take the opportunity to ask; does anyone have a good introduction to creating Ruby (not Rails) projects? I&#x27;m a bit confused between rake, bundle, testing frameworks, how to debug a program or structure a project and I can&#x27;t seem to find a good up to date resource on that.
评论 #29685684 未加载
评论 #29685526 未加载
评论 #29685935 未加载
评论 #29686855 未加载
评论 #29687138 未加载
nomilk超过 3 年前
I really can&#x27;t wait to use the IRB Autocomplete feature. Aside from the obvious advantage of tabbing (convenience, fewer typos etc), it&#x27;s a subtle way to improve discoverability of available methods. Very cool.
bradgessler超过 3 年前
PSA: Ruby 3.1 isn’t compatible with Rails 7.0.0. There’s a patch in the world that’s coming soon.
评论 #29689665 未加载
breatheoften超过 3 年前
How good is `debug.gem`? I&#x27;d be excited to try it if I was still using ruby ...<p>I&#x27;m not using ruby anymore but the debugger experience I had from vscode via the rdebug-ide library a few years ago was _mostly pretty_ nice aside from very performance limitations ... a massive performance improvement on that front must feel great!
hemantv超过 3 年前
What is best way to master Ruby for generalist engineer? I know C++ and Python, JS, Typescript well enough.<p>Python was easiest, since it took couple of days to master fundamentals and I was writing good code in no time.<p>Also anyone working on Typescript equivalent for ruby?
评论 #29686563 未加载
评论 #29686934 未加载
评论 #29688481 未加载
评论 #29751668 未加载
taf2超过 3 年前
Is yjit support available now for more cpu architectures? Super excited to try this out
评论 #29683229 未加载
评论 #29687857 未加载
firemelt超过 3 年前
did you guys know any updates about the static typing ruby? I wish it could be more like typescript
colesantiago超过 3 年前
has this released on stable with the asdf tool? can&#x27;t wait to try this out!
soheil超过 3 年前
Sigh... why couldn&#x27;t they drop the <i>:</i> like js?<p><pre><code> {x:, y:} is a syntax sugar of {x: x, y: y}.</code></pre>
评论 #29687018 未加载
评论 #29687675 未加载
评论 #29684752 未加载
评论 #29685031 未加载
评论 #29684787 未加载