8 ms·
Ruby 3.2.0
- claudiug 4y ago- JIT - WebAssembly support - Data immutable object - pattern matching - create gems with –ext=rust support - syntax_suggest
- dwheeler 4y agoIt also has performance improvements. They don't look earth-shattering in many cases, but performance improvements are always welcome because they are a win even if you don't use the new functionality. The improvements in memory allocation are likely to help many cases. Yjit has matured and is faster, so if you use yjit it's likely to be even faster at a cost of memory (and now uses Rust). Yjit was experimental so many would not use it in production... it is no longer experimental. This version also implements object shapes, which generally improve performance. For details see: https://www.youtube.com/watch?v=2aVyTtxs0GU https://www.youtube.com/watch?v=2aVyTtxs0GU
- Dawnyhf2 4y agoWhat’s that speed of this look like vs. Python 3.11? in a world where Python is getting major improvements Ruby is such a direct competitor it too must show similar improvements.
- evolve2k 4y agoWell the rust support goes a long way. Slow bottlenecking gems? Replace them with new rust native gems as of 3.2
- Dawnyhf2 4y ago[flagged]
- jeltz 4y agoRuby is faster than Python in many benchmarks but it obviously varies by domain so make your own benchmarks. Ruby also has JIT which Python does not.
- claudiug 4y ago[flagged]
- Dawnyhf2 4y ago[flagged]
- seif_madc 4y agoover the years people have done so much using Ruby and the other so called "dead languages", the new kids on the block will never do in a 20 or 30 years ahead.
- claudiug 4y agoto be blunt. I dont care. I dislike python, and i like ruby. I'm sure benchmarks will appear to tell us why ruby is slow, sucks, dead, etc. hell ycombinator is a hate club against ruby. as per speed, ruby 3.2 is 10% faster than 3.1 on shopify infra.
- vidarh 4y agoSame here. I've turned down jobs because it's not worth the pain. I would take one if desperate, or if offered sufficiently more, but, but thankfully few places require much Python for the kind of jobs I'm interested in. Ruby was fast enough for me to do what I needed with it already in the 1.8.x days. Every improvements since is gravy. A handful of times over the last 16 years or so I've needed to dip into C extensions for the performance I needed; but in those instances Python wouldn't even remotely cut it either.
- revskill 4y agoCould i know some reasons for you to dislike Python ?
- andrei_says_ 4y agoNot OP but I do - because I’ve tried Ruby and python feels like an extremely clunky and inflexible version of it - similar enough to feel quite close and remind me of all the flow and conveniences it doesn’t have. The feeling is like speaking to someone with a stutter or walking in a room filled with things to slightly stub your toe onto.
- claudiug 4y agoim writing python now as my current feature job I will list some crap that is mine, and my personal view. not an expert on python, not a programmer designer. I'm 100% convince that alternative exist, or im complete an fool. - self when writing oop/camelCase vs snake_casse others even better CamelCase_V1_magic_action - classes with lower cases / strange names - hundreds of lines of code per functions/ if/else/ etc. open sqlalqhemy and have a look - if you want async/away you need to colorise your function - __private__ - len/str, that is basically __len__ __str__ - package management - map/select/fold/ dont exists. just use [x in y for x in list] - := strange go var inside of if, that only work there - if you dont return from a function, then, what the function will return? a lot of web frameworks, that either copy(rails, sinatra, nextjs) - a lot of junior developers, with junior code or show to us code - python is basically a glue lang for c/c++ libraries - complicated deployment. - version management also a mess - cyclic import exception. it sucks. i know im at fault but is tsucks - people tend to write criple code, because python is easy. I think is a mistake. - asyncio is hard. but again my view here :) looks easy on js - I dislike decorators. - i dislike multiple inheritance :) - the str format demo.format vs f"{format}" vs whatever else end of random rants :)
- gls2ro 4y agoI don't know the comparison between them. But your question is also loaded (intentionally or maybe not). Why I say loaded? How you formulated includes the hidden assumption that Python is more advanced or faster. Thus it is not an open question. This may not be your intention, so I am sorry if I am interpreting it in the wrong way. I got triggered by this because a lot of people put a lot of effort into making this release happen. Don't take away their "wind" by asking veiled questions that hint that other languages are good, especially as this submission is just an announcement and does not make any comparision between Ruby and other languages. It is ok if you like Python more than Ruby. There is a place for everyone, and I wish people would adopt the mindset of "growing a pie" and not act like every release of any other language is a direct hit to their own choice. About speed, I would say this: - if you are creating a project with speed as the primary business value, then yes, don't choose Ruby. Choose C or Crystal - if your project is a web app, then it does not matter if you choose Python or Ruby - rarely a project that has speed a core business value dies out because it is slow. So from a business perspective, the criterium of speed is irrelevant.
- vinceguidry 4y agoYou can still use Ruby if you have a need for speed. Try JRuby, TruffleRuby, or mruby depending on the application. But be sure that MRI isn't fast enough. MRI will improve faster than any of the others.
- chucke 4y agoBenchmarks will eventually come out. However, put this into perspective. Ruby has a JIT. Python doesn't. Until it does, its performance is fundamentally capped by it. Ruby has two viable alternative runtimes, one that sees a lot of production usage (jruby) and another one which can run the same code as CRuby (truffleruby). Both do not have a GIL. Both have multi-tier JITs, and a huge upside. Most of the ecosystem is known to test compatibility with jruby, and the effort to do the same with truffleruby is well underway. Compare that with python, where not running Cpython comes with a lot of asterisks, mostly because the ML ecosystem that brought it to massive popularity can only run in Cpython. Ruby has overall more upside.
- Mystery-Machine 4y agoWow! I'm a Ruby on Rails developer and I always thought how Python language is more advanced because it's way more popular programming language than Ruby. Thank you for proving me wrong. :)
- ccouzens 4y agoThe web assembly support looks cool. Years ago I had a requirement for portable ruby on Linux. We'd been using Traveling Ruby which was looking very dated (it's been updated since). I chose to rewrite in Deno rather than sticking with traveling ruby. But had the official wasi cruby been available we could have stuck with Ruby for that project.
- evolve2k 4y agoThank you Ruby core team <3
- revskill 4y agoWish one day Ruby will have strong ML library support. Then i could just use Ruby for all the things.
- pointlessone 4y agoI'm not an ML expert so can't tell how good any of these are but there seem to be enough ML-related stuff for Ruby. There are a few tensorflow bindings for Ruby. There's torch.rb. There's numo, kinda like numpy. SciRuby lists a bunch of AI-related/numeric gems. What I'm trying to say is there's no reason to expect Python parity because there's Python and no reason to divert the effort but ML is not quite non-existent in Ruby. Start using it and be the change you want to see in the world.
- revskill 4y agoI don't want to touch Python, and that's the problem. So it's just a wish. But even if i love Python, the point is still: Make stronger ML support for Ruby.
- MegaSec 4y agoMaybe you should try Julia? That might still be too much like Python. https://julialang.org/ https://julialang.org/
- marc 4y agoThere are more than you might realize. Some good ones listed here: https://ankane.org/new-ml-gems https://ankane.org/new-ml-gems https://ankane.org/more-ml-gems https://ankane.org/more-ml-gems
- yebyen 4y agoDid you find these here on HN? This is the gem of the day for me I hadn't seen either of these, and I didn't think I was interested in ML, until I got to the Natural Language Processing section, this is a great article! Happy Ruby Upgrade Day!
- matheusmoreira 4y agoI didn't know Ruby had Rust support, that's seriously awesome. I suppose Rust extensions use the C ABI.
- matsadler 4y agoThe template generated with bundle gem —-ext=rust uses the Magnus[1] library that provides a high-level friendly Rust wrapper over the Ruby C API, but you can also use rb-sys[2] which is lower level bindings direct to the Ruby C API. [1]: https://github.com/matsadler/magnus https://github.com/matsadler/magnus [2]: https://github.com/oxidize-rb/rb-sys https://github.com/oxidize-rb/rb-sys
- n8ta 4y agoI was writing native extensions about 2 years ago so its been possible for awhile. The rutie crate for rust makes it much easier.
- ufuk 4y agoWe'd already deployed a prerelease version and started serving all Shopify storefront requests with Ruby 3.2 earlier this week. Here is a Twitter thread from me about all the work that into this release from Shopify with respect to performance and stability: https://twitter.com/paracycle/status/1605706226007941122 https://twitter.com/paracycle/status/1605706226007941122 If you have any questions, I am more than happy to answer them here. Merry Christmas everyone!
- purple_ferret 4y ago[flagged]
- synu 4y agoThey clearly haven’t read the HN comments about Ruby
- ksec 4y agoI am not aware of any HN comments that point to Ruby ( or Rails ) being a bottleneck. Most of them only suggest Ruby ( or specifically Rails ) being more expensive to scale.
- Existenceblinks 4y agoYou are too optimistic. The js mind virus is spreading inside fast. The old devs' moving up, the new naive devs' moving in. Web tech is heading towards what tech influencers and companies making money of. You will never see shiny VC backed companies pumping Rust outside of the bubbles.
- igravious 4y agoThanks for the detailed write-up. Great to see Ruby getting so much love. Already looking forward to 3.3 Is it a dumb question to ask what additional tooling you use to hop from one version of Ruby to another? There are so many: RVM, Rbenv, …
- 4y ago
- awesomegoat_com 4y agoRuby! What a gem. Seriously, I am super excited about this new release and I will try to deploy it to my prod during Christmas. Name any other tech that is 27 years old, that you feel excited about.
- robin_reala 4y agoCSS is 26, so almost!
- jeltz 4y agoPostgreSQL is 26 and is still something worth getting excited over and there are even older projects like Erlang, which is 36 years old, where there are still exciting things going on.
- nesarkvechnep 4y agoPeople just have to look around.
- deleted 4y ago[deleted]
- pjmlp 4y agoJava, with all ongoing research, although probably unpopular around here. ML going mainstream via F#, Scala, Rust, even changes in Java and C# to accomodate for ML like features. Haskell.
- itbeho 4y agoErlang
- rrgok 4y agoPHP :)
- type0 4y agoEmacs
- igravious 4y agoThis is what `ruby-build -l` is giving me 2.7.7 3.0.5 3.1.3 jruby-9.4.0.0 mruby-3.1.0 picoruby-3.0.0 rbx-5.0 truffleruby-22.3.0 truffleruby+graalvm-22.3.0
- pmdr 4y ago3.2.0 is there if you're using ruby-build as a rbenv plugin and having both as git-based setups.
- claudiug 4y agosome bechmarks from 3.1, 3.2 3.2 with jit https://www.solnic.dev/p/benchmarking-ruby-32-with-yjit https://www.solnic.dev/p/benchmarking-ruby-32-with-yjit
- nickjj 4y agoThis is looking really good. By the way if anyone ends up benchmarking Ruby 3.2 using Docker please be aware that the official Ruby image with a Debian base does not enable YJIT. It may not be included for 6+ months or more specifically not until Debian Bookworm is out[0]. That's because Rust 1.58+ needs to be installed. [0]: https://github.com/docker-library/ruby/pull/398 https://github.com/docker-library/ruby/pull/398
- Tolexx 4y ago[dead]
- jrochkind1 4y agoI would love to hear more about YJIT. Who's using it in production?
- claudiug 4y agoa small startup from canada, shopify https://twitter.com/paracycle/status/1605706226007941122 https://twitter.com/paracycle/status/1605706226007941122
- Lio 4y agoRuby’s tradition of putting releases out at Christmas is always like a nice little present to play with over the break up to new year. Cheers to everyone involved, it’s much appreciated.
- pvsukale3 4y agoThank you core team!