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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ruby 3.0 Preview 1

622 点作者 polysaturate超过 4 年前

31 条评论

sdwolfz超过 4 年前
My thoughts:<p>- RBS: meh... might get more useful in the future (in 2-5 years maybe).<p>- Ractor: Wohooo! I&#x27;m writing a DAG library where I was thinking of implementing something like this, good to know I can use it and get real parallelism on top.<p>- Scheduler: :shrug: don&#x27;t know about this one, might be relevant with future concurrent ruby code, any ideas?<p>- Rightward assignment: it&#x27;s a bit awkward but I see the use case, just wish we had the pipe operator too like in Elixir.<p>- Endless method: this one is cute, I love it!<p>- Find pattern: oh boy, code reviews are going to be interesting now!<p>- Hash#except: yes, definitely a welcome one.<p>- Memory view: if this helps with numpy style gems it will be great!<p>- `send(:&quot;do_#{ meth }&quot;, ...)`: don&#x27;t do meth kids! (it&#x27;s a joke!)... seems like a reasonable feature.<p>- `order of backtrace had been reversed`: good! it was confusing...<p>- Promote default gems to bundled gems (rexml): I like this one, if only nokogiri was a stdlib gem or part of core, imagine how much time would be saved instead of having to compile it every time in a `bundle install`.<p>- `Promote stdlib to default gems`: what does this mean? Do I now have to add `gem &quot;securerandom&quot;` to Gemfiles instead of having it by default and just needing to require it?<p>- Mjit improvements: can&#x27;t wait to try it!<p>Overall, I&#x27;m delighted!
评论 #24594162 未加载
评论 #24594733 未加载
评论 #24594897 未加载
评论 #24594353 未加载
评论 #24597849 未加载
评论 #24594321 未加载
reader_mode超过 4 年前
&gt;Rightward assignment statement is added. &gt;fib(10) =&gt; x<p>This is exactly the kind of stuff I hated when I had to work with ruby in my last gig and why I will never accept a job using it again - soo many pointless and inconsistent ways to do the same thing ... they have method aliases for collection operations like map&#x2F;filter in standard library ! .NET went with non-standard SQL-like names (select&#x2F;where) and I&#x27;m not a fan but at least they made their choice and stuck with it. And it&#x27;s inconsistent all over the place - like &#x27;!&#x27; postfix means &quot;operation mutates the object&quot; in std lib BUT in rails it means the operation will raise an exception and not return an error code.<p>Now they add a pointless operator that means completely different thing in other languages to throw off even more people.<p>It&#x27;s just a hell of a language to maintain someone else&#x27;s code in.
评论 #24594337 未加载
评论 #24596075 未加载
评论 #24596675 未加载
评论 #24596604 未加载
评论 #24595133 未加载
评论 #24595362 未加载
评论 #24595830 未加载
评论 #24596917 未加载
评论 #24595096 未加载
评论 #24596456 未加载
评论 #24595101 未加载
评论 #24596738 未加载
eddietejeda超过 4 年前
If you interested in seeing how the 3x3 initiative* has come along, here are the benchmarks so far: <a href="https:&#x2F;&#x2F;github.com&#x2F;mame&#x2F;optcarrot#readme" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mame&#x2F;optcarrot#readme</a><p>Personally, I am very excited for this release.<p>* Matz&#x27;s goal to get Ruby 3 to be 3x faster than Ruby 2.<p>--<p>@sosodev Thanks for the updated info!
评论 #24594100 未加载
评论 #24594609 未加载
评论 #24597407 未加载
rco8786超过 4 年前
This is all great stuff. I’m rather meh on RBS, mainly because separating types from code is less than ideal but I like the potential here.<p>But the right hand assignment operator. What on earth. Nobody asked for that and nobody wants it. Why.
评论 #24596624 未加载
评论 #24595275 未加载
评论 #24595647 未加载
phaedryx超过 4 年前
I have mixed feelings.<p>I&#x27;m not a fan of rightward assignment because I don&#x27;t see much value and now the =&gt; operator has even more meanings.<p>I&#x27;m not a fan of endless methods because how lazy do you have to be to not want to type &#x27;end&#x27;? My editor does it for me automatically. Now there is even more parsing.
评论 #24596870 未加载
评论 #24596962 未加载
d2161超过 4 年前
You can test your heroku app on the new ruby 3 preview already! (<a href="https:&#x2F;&#x2F;devcenter.heroku.com&#x2F;changelog-items&#x2F;1889" rel="nofollow">https:&#x2F;&#x2F;devcenter.heroku.com&#x2F;changelog-items&#x2F;1889</a>)
评论 #24594686 未加载
shadykiller超过 4 年前
I love Ruby and great to see Ruby love on hacker news. Just curious on how popular it is in the hacker news community ?
评论 #24593879 未加载
评论 #24596274 未加载
评论 #24595334 未加载
Justsignedup超过 4 年前
Reactor model. Nice. Very nice. So real ruby multithreading at last.<p>Okay time to upgrade to latest rails and wait for the multithreaded rails release. :P
评论 #24593578 未加载
评论 #24597481 未加载
评论 #24593651 未加载
jasonhansel超过 4 年前
Question: will the nonblocking scheduler start to make Ruby concurrency competitive with e.g. Node.js and Go? Currently Ruby mostly uses heavyweight threading mechanisms that cause trouble for I&#x2F;O-bound microservices.
评论 #24594232 未加载
评论 #24595115 未加载
评论 #24595056 未加载
评论 #24594732 未加载
gorgoiler超过 4 年前
It feels like RBS is for library writers, so that they can ship type information to help the <i>consumers</i> of their library. It’s not really aimed at the consumers themselves — the long tail of casual Ruby hackers like me.<p>If RBS was for end users, adding types inline with the source code would make more sense compared to the RBS approach: keeping the source file and typedef file in sync.<p>That might actually be a pretty smart move. At first it seemed inconvenient to have to maintain a separate file for the type information, but maybe this focus on type-checking being made easy for the 90% of us who hack scripts is a much smarter one.
评论 #24596595 未加载
crb002超过 4 年前
I wish I had kept maintaining my port of Ruby to the IBM BLue Gene&#x2F;L, &quot;Blue Ruby&quot;. It scaled to millions of cores with MPI. Had distributed versions of familiar Ruby data types. There was no fork() - restriction of the BGL kernel not supporting it - only green threads - making parallel operations truly parallel with independent Ruby VMs and passing code to data instead of data to code.
Jarred超过 4 年前
Does message passing mean it copies objects you send between threads &#x2F; fibers, rather than sharing memory?<p>JavaScript has a similar pattern with Workers, and it makes concurrency for hot code impractical. Serializing&#x2F;deserializing objects is a lot slower than just not doing that. In JavaScript’s case, you can also use SharedArrayBuffer, but Safari hasn’t re-enabled it.
评论 #24594004 未加载
wbharding超过 4 年前
It looks like the link they provide for comparing the source of 3.0 and 2.7 is busted on Github, but you can get a sense for the scope of this on GitClear&#x27;s Open Repos <a href="https:&#x2F;&#x2F;www.gitclear.com&#x2F;open_repos&#x2F;ruby&#x2F;ruby&#x2F;releases" rel="nofollow">https:&#x2F;&#x2F;www.gitclear.com&#x2F;open_repos&#x2F;ruby&#x2F;ruby&#x2F;releases</a>. Looks like about 4x more repo evolution has gone into this version than previous.<p>See also: list of the biggest tickets tackled in 3.0: <a href="https:&#x2F;&#x2F;www.gitclear.com&#x2F;open_repos&#x2F;ruby&#x2F;ruby&#x2F;release&#x2F;pending_release" rel="nofollow">https:&#x2F;&#x2F;www.gitclear.com&#x2F;open_repos&#x2F;ruby&#x2F;ruby&#x2F;release&#x2F;pendin...</a>
riffraff超过 4 年前
the link to the NEWS file is broken, it should be this<p><a href="https:&#x2F;&#x2F;github.com&#x2F;ruby&#x2F;ruby&#x2F;blob&#x2F;v3_0_0_preview1&#x2F;NEWS.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ruby&#x2F;ruby&#x2F;blob&#x2F;v3_0_0_preview1&#x2F;NEWS.md</a>
desireco42超过 4 年前
There were times where I would not be able to sleep when such a release was done :). It isn&#x27;t as much lately, but still, fantastic work by fantastic team. Congratulations!<p>There are some seriously good stuff there.
juliend2超过 4 年前
Happy to see developments on the pattern matching feature[0].<p>[0] <a href="https:&#x2F;&#x2F;bugs.ruby-lang.org&#x2F;issues&#x2F;16828" rel="nofollow">https:&#x2F;&#x2F;bugs.ruby-lang.org&#x2F;issues&#x2F;16828</a>
评论 #24595752 未加载
sickcodebruh超过 4 年前
Didn’t see it linked in the preview announcement, here’s the RBS syntax guide: <a href="https:&#x2F;&#x2F;github.com&#x2F;ruby&#x2F;rbs&#x2F;blob&#x2F;master&#x2F;docs&#x2F;syntax.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ruby&#x2F;rbs&#x2F;blob&#x2F;master&#x2F;docs&#x2F;syntax.md</a><p>Glanced at it from my phone but it looks good! I’m looking forward to seeing it in RubyMine. Still sad that we can’t write these in .rb files but I wonder if the plan is to go the other way, eventually permit typed code in .rbs?<p>Does anyone know what the story will be with third-party definitions? Are we headed towards a DefinitelyTyped style repository for Ruby?
评论 #24599497 未加载
aryik超过 4 年前
Great stuff! Does anyone who’s been in the Ruby ecosystem longer than me have a prediction for when Rails will support Ruby 3?
bilekas超过 4 年前
Am I alone in saying; for some damn reason, I don&#x27;t like Ruby.. I appreciate what it can do, and indeed what it does.. I just feel like I slipped in between that moment to appreciate it more. I will go and spend some time to learn it more but out of a novelty aspect.. And that makes me feel bad.
评论 #24596317 未加载
评论 #24597390 未加载
jakearmitage超过 4 年前
Endless Ruby is the best Ruby.
aitchnyu超过 4 年前
Not a Rubyist. Would Ractor allow one process to use up all CPUs while avoiding copying objects? Can I build shareable objects with immutable lists and maps right now?
评论 #24599439 未加载
phplovesong超过 4 年前
Look like a great release! Have not used Ruby in years, but i recon the Ractor and Scheduler brings some nice perf improvements.
pw超过 4 年前
Wondering how RBS will compete&#x2F;compare to Sorbet, which seems like a better solution.
评论 #24597085 未加载
nanna超过 4 年前
Anyone got suggestions for resources to learn Ruby and Rails in 2020?
评论 #24600093 未加载
justinzollars超过 4 年前
Rightward assignment looks gross.
sarfraaz超过 4 年前
I don&#x27;t know why am I writing this, but..
monadic2超过 4 年前
Ruby is a really cool language but I&#x27;m dying for an update where features are <i>removed</i>.
评论 #24595501 未加载
评论 #24597092 未加载
评论 #24597581 未加载
zelly超过 4 年前
So now there are basically no dynamically typed languages left. There&#x27;s Scheme, JavaScript, what else? All languages nowadays are converging to TypeScript&#x2F;Rust. It&#x27;s kind of sad.
评论 #24596356 未加载
评论 #24595909 未加载
评论 #24594052 未加载
评论 #24594050 未加载
评论 #24594642 未加载
评论 #24594278 未加载
评论 #24594699 未加载
hexbinencoded超过 4 年前
I left Ruby because the performance and security weren&#x27;t improving and the community was slowly dying. I delved into Go before that got flooded with newbs, then looked at Crystal and Pony, before settling on Rust and Haskell for most things.
评论 #24596490 未加载
评论 #24596696 未加载
评论 #24597450 未加载
stevebmark超过 4 年前
I really wish Ruby would grow up and deprecate method_missing
评论 #24593839 未加载
评论 #24594445 未加载
评论 #24593829 未加载
评论 #24593797 未加载
cutler超过 4 年前
Much as I would love to believe Ruby 3.0 delivers some kind of speed bump my simple test of doing what Ruby supposedly does best - parsing a log file with a regex - shows Ruby 16% slower than the Python equivalent.<p><pre><code> Ruby puts IO.foreach(&#x27;logs1.txt&#x27;).grep &#x2F;\b\w{15}\b&#x2F; Python from re import compile with open(&#x27;logs1.txt&#x27;, &#x27;r&#x27;) as fh: regex = compile(r&#x27;\b\w{15}\b&#x27;) for line in fh: if regex.search(line): print(line, end=&#x27;&#x27;) </code></pre> On my MacBook Pro (2013) running Catalina Ruby averaged 1.49 secs and Python 1.27 secs. The file `logs1.txt` is a 20Mb Apache log file. Pre-compilation with:<p><pre><code> reg = Regex.compile &#x2F;\b\w{15}\b&#x2F; puts IO.foreach(&#x27;logs1.txt&#x27;).grep reg </code></pre> ... slowed Ruby down to 1.57 secs.<p>Using --jit didn&#x27;t change Ruby&#x27;s overall time but considering it adds 700ms to Ruby&#x27;s startup time execution time was faster.
评论 #24595905 未加载
评论 #24595914 未加载
评论 #24596375 未加载