40 ms·
Ruby: We have decided to go forward to 3.0 this year
- maxpert 6y agoDid we get JIT?
- anonova 6y agoYes, it was introduced in Ruby 2.6 (2018): https://www.ruby-lang.org/en/news/2018/12/25/ruby-2-6-0-released/ https://www.ruby-lang.org/en/news/2018/12/25/ruby-2-6-0-rele...
- pizza234 6y agoWell, yes and no (althought the question is a bit open). It's more or less beta quality, and very primitive. It's discouraged to be used with Rails, so I'd be inclined to state that "we didn't get it yet". I'm also personally skeptical that the unusual approach (invoking a whole C compiler in a separate thread) will stand in the long term - but that's my own take.
- jashmatthews 6y agoThe CRuby JIT is stable but whether it improves performance or not is workload dependent. It's simple not primitive. MJIT is designed to take advantage of a C compilers optimization. "Compile to C" worked for Chicken Scheme for the past 20 years and continues to be a popular way for functional langauges to compile. It's also how Nim works. It's all about different trade-offs.
- oblio 6y agoChicken Scheme compiles ahead of time, doesn't it?
- pansa2 6y agoNim does too.
- jashmatthews 6y agoYeah but it's not an important distinction.
- oblio 6y agoIsn't it? Compiling C takes time, with Ruby you would be doing it for each execution. Is there some catching involved?
- jashmatthews 6y agoAlmost everything is in a pre-compiled header. Its actually similar overhead to an LLVM based JIT. You wouldn’t want to do it for a browser JIT but for a server side app it’s OK.
- oblio 6y agoDoes Ruby ship with a compiler? How will this work on Windows?
- pizza234 6y agoAre there any benchmarks available? It seems I can find very little (OptCarrot, some microbenchmarks, and some general assessments about usage with Rails), and a broad(er) overview is crucial to assess the overall performance (I suppose that you can have workloads where the performance degrades).
- ljm 6y agoI wonder what happened to that old planned feature where the ruby code would be byte-compiled into .rbc files?
- byroot 6y agoThe capability is there since 2.3 at least, but Matz doesn't want it by default, and prefer to leave it to libraries. If you use bootsnap, you use ".rbc" files already. Source: https://bugs.ruby-lang.org/issues/16847#note-14 https://bugs.ruby-lang.org/issues/16847#note-14
- jashmatthews 6y agoJRuby has a semi-optimizing JIT since JRuby 9000 was released in 2015. It's mostly non-speculative but still the fastest way to run Ruby in production. I've used it at several companies.
- ricardobeat 6y agoContext? What changes are in v3?
- splitrocket 6y agoThe goal of Ruby v3 is to be 3 times faster than v2. https://blog.heroku.com/ruby-3-by-3/ https://blog.heroku.com/ruby-3-by-3/ Unclear if that goal has been achieved.
- anonova 6y agoFrom benchmarks [1], 2.8.0 (with jit) is ~2x faster than 2.0.0p648 [2]. [1]: https://pragtob.wordpress.com/2020/08/24/the-great-rubykon-benchmark-2020-cruby-vs-jruby-vs-truffleruby/ https://pragtob.wordpress.com/2020/08/24/the-great-rubykon-b... [2]: https://pragtob.wordpress.com/2017/01/24/benchmarking-a-go-ai-in-ruby-cruby-vs-rubinius-vs-jruby-vs-truffle-a-year-later/ https://pragtob.wordpress.com/2017/01/24/benchmarking-a-go-a...
- sosodev 6y agoA lot of focus has been on this benchmark https://github.com/mame/optcarrot/ https://github.com/mame/optcarrot/ It has seen huge performance improvements thanks to the mjit but not quite 3x yet.
- geraldbauer 6y agoNot up-to-date but many more ruby 3x3 articles, see https://planetruby.github.io/calendar/ruby3x3 https://planetruby.github.io/calendar/ruby3x3
- mfontani 6y agoWhat a year! Python 2.x dying; Python 3 becoming the norm; "Perl6" renamed to raku & Perl5 thinking of bumping to v7... and now Ruby going all the way to v3.0!
- shinepl10 6y agoYou forgot about PHP going to v8
- digianarchist 6y agoJavaScript really does take over everything.
- e12e 6y agoHeh. More seriously, I think maybe deno[1] should be on that list, as a nodejs 2.0 / event loop for js 2.0? [1] https://deno.land https://deno.land
- rmccue 6y agoI know this is a joke, but we’re legitimately running v8 as a PHP extension in production on high-traffic sites. It’s actually quite good for server-side JS rendering when you’re working inside an existing PHP framework (WordPress, in our case).
- charrondev 6y agoMind linking anything on how you’re doing that? We’d looked into a couple years ago but it seemed quite complicated from a setup perspective.
- canadev 6y agohave you a link handy?
- some_furry 6y ago
- sacado2 6y agoAre they going to make non-backward-compatible changes, or is this just a marketing move?
- ilikepi 6y agoIt might be a little of both. I did come across this change to keyword arguments[1] recently, but I'm not sure how impactful it is since I don't personally leverage keyword arguments right now. [1]: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/ https://www.ruby-lang.org/en/news/2019/12/12/separation-of-p...
- d3nj4l 6y agoIt sure does blow up your logs if you're using rails with 2.7.1.
- sosodev 6y agoHave you updated? Pretty sure all the warnings have been fixed now.
- ljm 6y agoProblem is if you're stuck on gems that aren't maintained any more. Seen a few with PRs containing fixes going stale. Can still switch to a fork, at least.
- jamie_ca 6y agoYeah, core rails the only warning I've seen is a single one in sprockets-rails (brand new app from last week).
- d3nj4l 6y agoCan't update at work, there's a few breaking changes :/
- pmarreck 6y ago
- tiffanyh 6y agoIt appears that Ruby 3 might come short of their 3x speedup goal [1][2] ... has anyone tried out Graal/TruffleRuby? Graal/TruffleRuby has shown some massive perf increases [3] [1] https://pragtob.wordpress.com/2017/01/24/benchmarking-a-go-ai-in-ruby-cruby-vs-rubinius-vs-jruby-vs-truffle-a-year-later/ https://pragtob.wordpress.com/2017/01/24/benchmarking-a-go-a... [2] https://pragtob.wordpress.com/2020/08/24/the-great-rubykon-benchmark-2020-cruby-vs-jruby-vs-truffleruby/ https://pragtob.wordpress.com/2020/08/24/the-great-rubykon-b... [3] https://www.reddit.com/r/ruby/comments/b4c2lx/truffleruby_being_2x_faster_than_mri_26_a/ https://www.reddit.com/r/ruby/comments/b4c2lx/truffleruby_be...
- owens99 6y agoLook for tenderlove’s comments on TruffleRuby. The performance is at the expense of memory.
- eregon 6y agoWhich comments?
- loic-sharma 6y agohttps://blog.heroku.com/ruby-3-by-3/ https://blog.heroku.com/ruby-3-by-3/
- deleted 6y ago[deleted]
- sickcodebruh 6y agoI’m excited about performance improvements but thrilled at the idea of adding types. Has anyone here worked with Sorbet or a prerelease 3.0 in Rails and able to share some notes?
- pqdbr 6y agoI'm also very excited for Sorbet. Not because of types specifically (I don't use them and don't plan to), but because I hoped it would give me the same linting experience that ESLint gives me on JS files (unused variables, undefined methods, calling methods on nil, and so on). The sorbet demo (https://sorbet.run/ https://sorbet.run/) is all I could wish for (you can remove the type signatures and see that it would still warn you about the `.barr` typo). However, it is still a great deal of work to set it up on Rails (Sorbet is made by Stripe, they use Ruby but not Rails), and I couldn't finish the setup because of some gem warnings that I couldn't updated at the time. Hope to give it another try soon!
- hdoan741 6y ago@pqdbr: sorbet-rails maintainer here. We make the library to bridge the gap between sorbet & Rails. If you have any issue with setting up sorbet and/or sorbet-rails. Hit me up with issues on the repo and I'll try to help!
- bradleybuda 6y agoOur team has been using Sorbet at getcensus.com for almost a year now, and I'm generally very happy with it though it's not perfect. Like most non-trivial Rails apps, our test suite takes a while to run, so I like having Sorbet to catch "dumb" issues without having to run the full suite. Running `srb tc` to check types is incredibly fast and seems to be scaling well as our codebase grows. It catches the obvious stuff, but has also found some subtle bugs in flow checking and is great for refactoring support. The false positive rate is extremely low - if Sorbet flags a regression in your type checking, it's very likely to be a real bug. The Slack community is helpful and responsive - if you're thinking of using sorbet, I'd strongly suggest joining. The downsides are: - Unclear workflows - it's hard to know when you need to "rescan" for new type definitions in gems, the stdlib, and in generated code in your own app - Poor Rails integration - the sorbet-rails package is helpful and being actively developed, but it's clear that the maintainers don't use Rails and aren't going out of their way to support it. - Upgrades are rough - the sorbet tools that scan your gems and code to find "hidden definitions" are seemingly unstable from release to release. There's a good chance that upgrading to a new version of sorbet will break your type checking for mysterious and hard-to-debug reasons. Lots of this is probably related to Rails as well. - IDE integration isn't quite ready for prime-time yet. I've gotten it working in Emacs with lots of experimentation and poking around, and I think some folks have it working in VSCode too, but it's not officially "released" or supported and it crashes somewhat often. It's still stable enough to be useful and I'm glad I have it. It's great and seems to be getting better, and it has absolutely made me more productive, but know that you're still adopting an alpha- or beta-quality tool and it's unlikely to "just work".
- mrtweetyhack 6y agoLooking forward to it! Thanks for all the good work.
- sunnydey 6y agoI'm waiting for this since long time. Hope it will be more human and more feature and more user friendly than other languages.
- sunnydey 6y agoI'm waiting for this since long time. Hope it will have more features, more faster, more performance oriented, more exciting, and more user friendly than other languages.