18 ms·
Ruby 3.0
- rantwasp 6y agothis is awesome. as a long time Ruby used I appreciate the effort that continues to be put into making Ruby better.
- TimTheTinker 6y agoMatz has a long history of releasing major Ruby updates on Christmas Day. He is a nice guy and enjoys giving the world a good Christmas present.
- dang 6y agoRelated from 4 days ago: https://news.ycombinator.com/item?id=25494789 https://news.ycombinator.com/item?id=25494789
- submeta 6y agoThank you for maintaining quality in this community even on a Christmas morning. I get the impression you are doing your job 24/7.
- pvg 6y agoeven on a Christmas morning It's on a different day in Canadia
- cercatrova 6y agoHuh? Still Christmas morning currently even on the very eastern coast of Canada.
- garmaine 6y agoMaybe this is supposed to be a Boxing Day reference?
- stan_rogers 6y agoThanksgiving, more likely.
- throwawaygimp 6y agoI'm not sure I would still have the will to keep coding without ruby
- bubblesorting 6y agoRuby has definitely helped me get through some rough and tight spots. So many things are easily able to bum me out, while Ruby goes out of its way to make me happy. > Welcome home. Things are going to be fine. Don't worry about nonsense. Just `:chill` A beloved safety blanket that makes it easy and fun to do boring everyday tasks.
- will_pseudonym 6y agoWhat are your thoughts about it being the 7th most dreaded language on Stack Overflow's 2020 developer survey? I've never programmed in Ruby, but it seems attractive to me.
- bdcravens 6y agoI think that says more about who takes the survey.
- berkes 6y agoI honestly cannot believe that this is a solid metric. I believe the question, or their answers are poorly parsed. I presume a lot of the dread is really about Rails. And the rest partly hearsay of the slow performance of Ruby. Rails is, to me, a blessing, but also a terrible framework. It helps to rapidly ship products. Just cobble some gems together in a controller or two, mix a gem or three into your models and you have a demo. A rapid Proof of Concept. But also a product that is practically unmaintainable. I've been doing Rails from its very beginning, solving this (trying to) has been my primary job for over seven years now. And performance? Yes Ruby is slow. But the speed of the language is unmeasurable in, I daresay, the vast majority of the projects of people who tell you it is too slow. That legacy mysql setup, this poorly evolved domain model, or that badly integrated external API is almost always the thing making it slow. The ms of Ruby handling that JSON to CSV conversion then is practically unmeasurable. Rust is not going to speed up those 3000ms spend in that ugly SQL query. Go's multithreading is not going to solve the slow API which you call thrice per minute. And Java is not magically making the tangle of classes, jobs, callbacks, listeners and whatnot dissapear.
- Ecco 6y agoSo apparently Ruby 3.1 is the version they expect the JIT to be actually efficient for Rails. Cool :)
- ksec 6y agoThat is what they hope to have improved by 3.1. So far nothing has shown JIT will make Rails any faster. TruffleRuby is gaining ground inside Shopify though.
- pvsukale3 6y agoI owe my career and livelihood to Ruby, Rails and the community. When I started learning programming I was overwhelmed because of c, c++ and JavaScript. Tried a bit of Python too. I thought I would never get a hold of any programming language ever. One day I tried this mysterious language from Japan(That's how I knew Ruby at the time) on tryruby.org. Ruby was breath of a fresh air. Code read like English. I was making small CLIs which required so much work in every other language. That was enough to get me hooked. Then I learned about Rails and never looked back. Happy to see this language making new strides with this release. This is a thank you note to Matz and the community.
- Papirola 6y agosame for me. it set me free from Java. Ruby is truly a gift.
- pmcollins 6y agocouldn’t agree more. learning ruby and rails (in 2007 when things were much simpler) was a truly beautiful experience for me. i consider rails and ruby to be one of humanity’s great works of art.
- tutfbhuf 6y agoHow complicated is rails in 2021?
- herbst 6y agoMore, but not a lot (comparingly)
- izietto 6y agoI'd say less than 10 years ago, because many not-so-edge cases have been fixed, and the new sections of the framework (activestorage, active job) simplified the development of some features that were harder to integrate some time ago
- speleding 6y ago
- pkdpic_y9k 6y ago"Often people, especially computer engineers, focus on the machines. They think, "By doing this, the machine will run faster. By doing this, the machine will run more effectively. By doing this, the machine will something something something." They are focusing on machines. But in fact we need to focus on humans, on how humans care about doing programming or operating the application of the machines. We are the masters. They are the slaves." Matz 2003 https://www.artima.com/intv/ruby.html https://www.artima.com/intv/ruby.html
- jhvkjhk 6y agoThe cobbler’s children have no shoes. Matz bring them shoes.
- doodpants 6y agoActually it was _why the lucky stiff who originally brought the world shoes [1]. :-) [1] http://shoesrb.com/ http://shoesrb.com/
- mrmonkeyman 6y agoAs a computer engineer you need to focus on computers, not people. I know this is popular right now, but it sucks and it is wrong and leads to bad results. Yes, the current state of affairs is a "bad result", young ones. We expect civil engineers to account for people, but they think about materials, planning, math, etc. Stay close to your craft or you might see it and/or your position in it evaporate.
- jashmatthews 6y agoWorking in a small civil engineering firm is almost exactly the same as working in software. It's all about people.
- mrmonkeyman 6y agoI'd rather avoid the bridges you build then.
- deleted 6y ago[deleted]
- runawaybottle 6y agoWhere does Ruby rank in the most beautiful languages ever made?
- yladiz 6y agoI don't know about beauty, because what's beautiful to one programmer might look terrible to another. For example, functional programming, especially as you get closer to point free style - some people love it and find it truly beautiful and others find it obtuse and distasteful. That said, I do think that Ruby is one of the most expressive general purpose languages, for reasons like being able to chain function calls without needing to add parentheses or some other call notation. There are surely DSLs or more obscure languages that are more expressive, but I would argue that few general/widely used languages are as expressive as Ruby, and so to answer your question if allowed to equate beauty with expressiveness, I think Ruby ranks very highly.
- scns 6y agoI would say point free is a case of form over function, beauty over readability. Other examples would be slim laptops with loud fans and those low height keyboards that get blocked by small particles.
- ehaliewicz2 6y agoMy 2020 macbook pro had probably my favorite keyboard. The low travel means I could type far faster on it than any other keyboards I've used. My 2019 is almost as good, except it has the issue of keys getting stuck/jammed by small particles, the 2020 version apparently had that issue resolved.
- cdogl 6y agoI’ve been working as a developer for9 years. For most of that time I gravitated toward the DevOps/SRE/Platform niche because I care about quality, but the process of developing resilient, maintainable and clean code in all the languages I had used seriously (PHP, Python, JavaScript, C, Go) just didn’t work with my mind. I couldn’t wrap my head around it and make myself apply the discipline. A year ago I was dropped in as the lead on a large Ruby project. Suddenly everything clicked. Now all the reading I’ve done on domain driven design and TDD actually has meaning and I’ve written more solid code in a year than the rest of my career combined. And on top of that, while every corner of tech has its toxic personalities, the Ruby community is overwhelmingly friendly, welcoming and mature.
- lmarcos 6y agoI'm curious, which toxic personalities are you talking about? I'm not very aware of the personalities in the software engineering world, but I would like to know what other people consider "toxic" in the software industry.
- ArtDev 6y agoIt's the snarky know-it-all types who talk down to you as if they were not, also, a noob once too. We are all noobs, at something. It's better to be kind and feel good about helping and sharing knowledge. Luckily, Q&A sites like Stackoverflow, force the question to be answered.
- cdogl 6y agoTo be up front here, I am generalising based entirely on my personal subjective experience and the reports of some peers and friends. Many of the language communities I’ve been involved with have been dominated by behaviours such as: - gatekeeping - elitism - subtle sexism - credentialism - (most frustratingly) a general sense that “our” community is somehow superior to others (people often hurl this nonsense toward PHP and JavaScript developers in particular). I remember going to a Go talk where one of the founders of the language was speaking to a small group. An audience member who was an avid Go user asked a simple, innocent question about some shortcoming of the language. He copped a sarcastic and dismissive response from Pike, which of course then acted as the signal for everyone else to treat him the same way during the casual drinks and pizza after the session. I’ve seen this sort of thing time and time again both professionally and in the meetup / conference space. On the contrary, the Ruby development community across three different Australian cities is dominated by people who have a solid baseline of emotional intelligence and worldly perspective. This filters through the community and creates an environment that I personally find to be far more welcoming and intellectually stimulating.
- scruple 6y agoThese releases have become one of my favorite Christmas traditions. I've been using Ruby since 1.8.7. It's really come a long way since those days. It was my primary or only language for over half of a decade and even though it is no longer my daily driver I still find myself having a lot of fun programming in it when the opportunity arises.
- deleted 6y ago[deleted]
- sundarurfriend 6y agoSo with the promised 3x speed improvement (hooray!), where does Ruby stand with regard to performance, compared to say Python? According to [this benchmark][1], it seems (the 3.0.0-preview1 version was) on average about 2x slower than Python. Are there other benchmarks to compare with? Looking into it, this other benchmark [2] of 3.0.0-preview1 vs Ruby 2.7 actually concludes there's no real performance improvement there. So I guess an additional question is, is there actually a 3x speed increase in realistic benchmarks? [1] https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/yarv-python3.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... [2] https://www.fastruby.io/blog/rails/performance/ruby/hows-the-performance-of-ruby-3.0.0-preview1.html https://www.fastruby.io/blog/rails/performance/ruby/hows-the...
- pansa2 6y ago> where does Ruby stand with regard to performance, compared to say Python? In my experience Ruby has been faster than Python for a long time - ever since its performance improved significantly going from 1.8 to 1.9, and Python’s got worse going from 2.x to 3.x.
- thirdusername 6y agoPython 3.6 was pretty much on par with 2.7 and that was 5 years ago. There doesn't seem to be any meaningful difference between python and ruby these days at all https://benchmarksgame-team.pages.debian.net/benchmarksgame/index.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- Rochus 6y agoI did some measurements recently with 3.0.0 RC1 compared to 2.1.0 based on https://github.com/smarr/are-we-fast-yet https://github.com/smarr/are-we-fast-yet. Here are the results: http://software.rochus-keller.ch/are-we-fast-yet_crystal_ruby_2_3_lua_node_i386_results_2020-12-23.pdf http://software.rochus-keller.ch/are-we-fast-yet_crystal_rub.... Ruby 3.0 without JIT is factor 1.2 faster than Ruby 2.1.0; Ruby 3.0 with JIT is only factor 1.4 faster than Ruby 2.1.0. Crystal is about factor 20 faster.
- riffraff 6y agoTo me, 3.0 is not super interesting per se, but it's a great ground to make future releases compelling, congrats to everyone involved, and thank you for your work.
- joelbluminator 6y agoThe thing is the language is complete (imo). I don't want them to reinvent the wheel or break backwards compatibility like python 3 did. And please don't introduce explicit types into Ruby for god's sake. So what's left to work on? I guess the things they're doing now: better performance, better tooling etc.
- epergo 6y agoCompletely agree about the tooling bit, after working during some time with Golang (just a bit during these past years) one of the things that I most like about that language is the set of official tools that it has, from formatting your code to check for security issues or unreachable code. It helps the developer to be more confident about its code.
- pdimitar 6y agoDouble down on actors and async I/O, make scheduling preemptive like the Erlang's VM does, and make message passing the preferred way to do multicore-CPU-enabled work. Nobody is requesting new language features for ages now. They are very rarely needed. The runtime is what needs a lot of work.
- joelbluminator 6y ago> make scheduling preemptive like the Erlang's VM does Care to explain this one? Btw Actors are basically pushing everything to an event loop, right?
- pdimitar 6y agoYes they do but that won't help you if one bad actor (literally and figuratively) takes a long time to execute a single function call. Erlang's VM has machinery to multiplex actors on separate CPU cores and keeps around several different kinds of thread pools -- native (as in Erlang bytecode) actors, dirty I/O threads (where potentially long-lived I/O will live) and dirty CPU threads (where CPU intensive tasks go) -- and can move actors between them (although let's be honest, nobody can make that work reliably and Erlang makes mistakes there as well). Basically, as they call it, several different schedulers, each with its own pre-warmed thread pool. An event loop is a step in the right direction. I am just worried that Ruby 3.0 might turn out how OCaml Multicore is turning out -- an endless saga.
- betwixthewires 6y agoI've been considering learning Ruby to replace Python for high level coding and scripting, Python is what I use for most of what I do. Should I? The main reasons I have not are inertia, massive selection of data manipulation libraries in Python, difficulty of async and multithreading in both languages means not much benefit from a usability perspective, and I'm not a fan of the Contributor Covenant CoC. But I have looked at the syntax of Ruby and find it to be more elegant. Does anyone knowledgeable about it have any useful information?
- joelbluminator 6y agoDepends on how much of a drag you feel Python to be. People sometimes want a change for change's sake. If you think you're happier using Ruby well that's a good enough reason to seriously consider it. Outside of machine learning I can't really see any objective advantage one has over the other. Both are super mature, expressive, dynamic languages. The rest is a matter of taste. Jobs wise I'm sure Python has an avdantage, but Ruby has some strong niches (web development, devops) that are always in high demand as well.
- tachyonbeam 6y agoIMO Python has more libraries, more developers (people who might want to work on your project with you), and a more simple and intuitive syntax (easier to onboard people). Ruby is a fairly quirky language, eg functions aren't first-class values.
- joelbluminator 6y ago> and a more simple and intuitive syntax That's the crux of it here. People really differ about this and OP should check it out for himself. Yes Python has more usage, I hardly think it really affects one's work in any meaningful way. Javascript has tons of developers using it, many times this is a con actually. An explosion of libraries and conflicting views and philosophies.
- vidarh 6y ago
- cercatrova 6y agoRuby is nice but I lament that it's a dynamic interpreted language. As I said in another comment, it's a shame we don't fully utilize our hardware and instead throw away our gains by piling on more useless abstractions in the name of "human experience". Spoiler alert, other languages can have good UX and still be fast, like Rust with algebraic data types, modern C++ with auto pointers, Haskell despite its garbage collected nature, Nim which is like a compiled Python, or hell, even Crystal which is like a compiled Ruby.
- pjmlp 6y agoThere is some hope with Crystal.
- darthrupert 6y agoHow about Common Lisp. It`s like a compiled Common Lisp.
- geraldbauer 6y agoCongrats! To celebrate Ruby and the Ruby community, the Ruby Advent Calendar 2020, December 1st - December 25th - 25 Days of Ruby Gems highlights ruby scripts in action - packaged up in gems for your convenience and for easy (re)use, see https://planetruby.github.io/gems/ https://planetruby.github.io/gems/
- pull_my_finger 6y agoDid they rush this release to make their arbitrary Christmas deadline? Seems like rc1 just came out a few days ago
- gautamcgoel 6y agoBoth Python and Ruby have grafted on new features to support type checking and concurrency. I would much rather just use Go, which was designed with these features baked in right from the start. Simpler, cleaner, and faster.
- pdimitar 6y agoErlang and Elixir say hi. Also several Rust runtimes.
- sam0x17 6y agoThe Ractor support is very welcome and needed. I've tried several times over the years to do concurrent HTTP requests using various gems, and was never able to get it working properly. Great to see a true message-based concurrency model.
- deleted 6y ago[deleted]
- almokhtar 6y agoLove it, Thank you
- pdimitar 6y agoHaving actors and some async capabilities might make me return to Ruby. I always liked the syntax and the ecosystem but felt like they were dragging their feet sitting at ancient computing paradigms for way too long. (Transparent parallelization like in Erlang/Elixir, anyone?) I feel the same way towards OCaml and its multicore saga as well. I figured I'll just wait for 5.0 which is due at the end of 2021 (at least) and then will start afresh there without having to do 100+ legacy code and compatibility dances, and have multicore from the get go. (Sort of like starting with Python 3 and never touching 2, I suppose.) Back to Ruby, I always felt it was too slow as well, at least when paired with Rails anyway -- JS and Erlang/Elixir are much faster and are still dynamic. But with 3.0 I might make a return to it. Shame that IO#select isn't supported but with async and actors that's likely not a big problem. Here's to exciting times ahead.
- walski 6y agoThe BZ2 archive is currently (?) missing from https://cache.ruby-lang.org/pub/ruby/3.0/ https://cache.ruby-lang.org/pub/ruby/3.0/ for the 3.0.0 release version. ruby-install uses that by default on my Mac and is failing. This works in the interim: ruby-install -u https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.0.tar.gz https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.0.tar.gz ruby 3.0.0
- walski 6y agoSeems like 0.8.0 might be fixing this.
- sdwolfz 6y agoWith MJIT showing such a big improvement (for particular cases anyway) starting with this version, I hope more people start writing code/gems that take advantage of this. You shouldn't sacrifice the ergonomics of your API just for the same for performance IMHO, but there should probably be nice gains here and there. Best of all would be if ruby code becomes good enough that you no longer need to FFI into C code, who knows, maybe ruby 3 will be the start of the `ruby only nokogiri` age :).
- mark_l_watson 6y agoI remember when Rails first was released. I kept the source code for Ruby and for Rails handy, and it was sort-of possible to wrap my head around both. One of the most fun non-AI conferences that I ever went to was Merb Camp in San Diego where the Merb team announced merging with Rails. I have such good memories of the four or five years when Ruby was my main driver. Great job by Matz and core team with the 3.0 release. I have gone back to my 1980s roots and now once gain use Common Lisp as my main driver, except for deep learning where I need to use Python (tried Julia and Swift). I think Matz has it exactly right. As programmers it is important to be happy using a language. Life should be fun most of the time, and there is nothing wrong with trying to optimize life for maximum joy we bring to ourselves and other people. BTW, happy holidays!
- fishmaster 6y agoWhy didn't you stay with Julia? PyCall.jl might be helpful to replace Python.
- mark_l_watson 6y agoI liked Flex for deep learning. I set Julia aside because I was managing a deep learning team at work and we were all in for Python.
- dunefox 6y agoThat makes sense. What did you use Flux for? I'm getting into it for natural language processing, hopefully during a PhD sometime in 2021.
- thrwn_frthr_awy 6y agoI still feel we the Merb “merger” was less than a merger and more of funding being cut for Merb development. Not sure if Engine Yard didn’t see a future in Merb or what, but it felt weird after so much rhetoric about the modularity of Merb over Rails to just see Rails gobble up Merb in just a couple of months. Either way, I wish I never threw out my sandals and I still miss Ezra :(
- crazypython 6y agoOn a tangent, Python has a static type system. It's been a part of the language for years now. It works much better than TypeScript– I would say it's as flexible as Haskell's type system while being extremely easy to use and catching many bugs. def sum(a: int, b: int) -> int: ... Unlike Ruby and JavaScript, Python is strongly typed. You can't add a string to a number, for example. Because it's strongly typed, it's much easier to add a type system. When I first started using the type system, it felt like it was always a part of the language, they just added a syntax and a checker. It doesn't restrain me from what I would otherwise normally do in the language like TypeScript or Flow does. It's a perfect fit.
- pmontra 6y ago"1" + 1 fails in Ruby too. It's as strongly typed as Python. Perl is the other dynamic language that allows that, maybe also PHP?
- deleted 6y ago[deleted]
- fny 6y agoAre frozen string literals out or will I have to keep adding comments to my code?
- jjice 6y agoI feel left out since I never learned Ruby. I love a range of programming languages, but I never had a reason to learn Ruby. It looks so powerful and seems to have a lot of quality of life features (backticks for a subprocess seems awesome for scripting). When I've considered to sit down and learn it, the big question always pops in my head: "is Ruby dead?". I think that's because of the lack of its prevalence in my life, because it seems like HN loves it and this most recent version seems fantastic, especially with some more advanced static analysis. I wish I didn't have that idea of Ruby being dead for as long as I had, because it really seems beautiful. Maybe I'll have to make Ruby my next language project.
- deleted 6y ago[deleted]
- burlesona 6y agoRuby is far from dead, it’s just past the hype. Fortunately in the last year or so I’d say it’s also past the blowback that comes to yesterday’s hype tech when the next hype tech arrives. (Have fun with Deno, Node.) Ruby really shines into areas: general purpose scripting (it was originally designed to be a bash replacement), and web development (because the ecosystem is very large). As the primary language for GitHub, Stripe, Shopify, AirBNB and many others, Ruby will likely always have a vibrant niche in web world, even if it never expands far beyond that circle. And for general purpose scripting, I mean, any language you enjoy using is a good choice for writing your scripts in.
- jrsj 6y agoI kind of doubt Deno will see much serious production usage. There’s not much practical point to it from a business perspective. The only way it would become popular for most use cases would be if it had Node compatibility, which doesn’t seem to be happening regardless.
- OOPMan 6y agoRuby 3x3...terms and conditions apply ;-)
- jaredcwhite 6y agoBefore Ruby, I just hacked stuff together as a hobbyist trying to figure out how to earn a living. Ruby is what forged me into a Programmer with a capital P, and it continues to rock my world to this very day. Congrats to the Ruby team and everyone involved in the release of v3. I hope the groundswell of excitement and enthusiasm I see is proof once and for all that Ruby is alive and well.
- mrwnmonm 6y agoMan, you got to appreciate Go's simplicity.
- InitEnabler 6y agoFinally 3.0 is here! So now we're at this point what's next?
- sebiw 6y agoI just wanna say thank you to all people who behind the scenes keep evolving Ruby as a programming language! I was at the edge of giving up on programming some long time ago and Ruby drove back a lot of my passion for creating things. Ruby 3 is yet another great release (Ractor for parallelism for example). Can't wait to see what 3.1 will bring.
- betoharres 6y agoif wasn't for ruby, I'd probably be done with programming; I remember my frustrations with PHP and Zend Framework, then I discovered ruby and rails, it was night and day; Thanks Matz and to all the great devs around this, wish you all the best!
- jshen 6y agoRactor looks really nice. Does python have anything similar to it?
- nine_k 6y agoTo help make sense of the changes: https://rubyreferences.github.io/rubychanges/3.0.html https://rubyreferences.github.io/rubychanges/3.0.html
- neop1x 6y agoI wrote a coule of small CLI tools in Ruby. I really liked how a single line could do a lot of work and those fancy syntax sugars. But I found it difficult to work with due to bad code completion suggestions in IDEs and overall poor documentation. I never knew what objects a function could return without reading the code or trying to call it first and inspecting the response. Then I switched to Go and Python and found those best-suited for all my needs.