15 ms·
Shopify invests in research for Ruby at scale
- no_wizard 4y agoThis is pretty amazing. Its also something that while I'm not surprised, I'm curious (if anyone from Shopify wants to weigh in that'd be even more cool) that they aren't taking the approach that I've seen other large Ruby based enterprises take, which is moving critical functionality to a more complimentary stack, such as Go or Elixir for speed improvements. Is really investing more into Ruby in this fashion better than the alternative? EDIT: I posit the last question as well..a real question. In another words, I guess we'll find out how this goes! I don't know what the "right" answer is. I'm more interested in the trade offs they evaluated on this front, or if its such that 500K is just a "hail mary see what happens" situation
- skinnymuch 4y agoNot sure about what’s best from a pure corporate financial perspective. It is really nice for one of the likely upcoming tech behemoths to still be pushing Ruby like Shopify is doing and has been doing.
- giraffe_lady 4y agoThose might be complementary but they are still other languages. They have completely different semantics, performance characteristics, deployment stories, etc that will need to be learned, developed and supported internally. It seems like they like ruby and appreciate what it allows them to do. There's no particular reason to think that the strengths they value in ruby will be present in those or any other languages either. They mentioned metaprogramming for example and it truly does feel easy and powerful in ruby in a way that I've only felt in certain lisps otherwise. Presumably they're heavily invested in certain techniques and powers, have earned and maintain internal expertise in them and find them valuable. Moving the critical functionality into a language where they'd be giving up that hard-earned expertise is a bold move. It may be the standard move, but imo it's pretty radical and a fairly significant gamble. If you're pushing the limits of a language that otherwise works very well for you, expanding those limits does seem wise, even the conservative choice.
- ilrwbwrkhv 4y agoMetaprogramming, yes but also pure objects. Ruby has that Smalltalk heritage in a way no other language has. Also the fact that it focuses on developer happiness makes it a way more pleasant language to use compared to say Golang or Rust.
- pjmlp 4y agoOther than SELF, Objective-C, Dylan or Common Lisp.
- specialp 4y agoI have been working with Ruby for over a decade and IMO most metaprogramming is the worst part of Ruby code. It makes code very difficult to reason about outside of runtime and makes unclear traces when something does go wrong. Now I know it can be done right, but I think the Ruby community ran too much with DRY (Don't Repeat Yourself) and "clean" minimal syntax at the cost of maintainability and readability. It also makes it hard for tools to reason about what is being run as well when you have stuff running in `instance_eval` contexts and `method_missing` being abused. So now here we are trying to unravel that by trying to make the interpreter smarter with caching to improve performance but if I had to turn back time, I would reverse every instance where one tried to be clever with metaprogramming in the name of syntax.
- giraffe_lady 4y agoYeah I kinda knew I'd regret mentioning any specific feature of ruby that one in particular. Anyway it doesn't matter. The point was that they presumably have identified certain things ruby does well for them and have invested heavily in them. If ruby does other things less well then abandoning ship for an unknown set of tradeoffs is a riskier move than improving the specific weaknesses that are their obstacles. What ruby's inherent strengths are or even if they exist at all doesn't matter as much as their investment and expertise in them does.
- jimbokun 4y ago> They have completely different semantics, performance characteristics Many times it is the different semantics that allow for better performance. If you can add new methods or change their implementation at runtime, performance optimizations get a lot trickier, for example. The immutability that's foundational to Elixir and Erlang enable the incredible scaling capabilities of the Erlang VM.
- tomhallett 4y agoI wonder if there is a fear of talent drain if management starts signalling that there's a "better" language being brought in for the "critical" things.
- pizza234 4y ago> I'm more interested in the trade offs they evaluated on this front, or if its such that 500K is just a "hail mary see what happens" situation It's actually much more than 500K. I think they have at least 6 very senior devs working on it¹. I think 3 million $ per year is a very conservative estimation. That said, it's definitely very mysterious what their analysis was. ¹=https://shopify.engineering/porting-yjit-ruby-compiler-to-rust https://shopify.engineering/porting-yjit-ruby-compiler-to-ru...
- hirundo 4y agoI recognize Tenderlove in a photo, so whatever they're doing is probably more than Adequate. If Aaron is involved I'm bullish. It's great to see Shopify giving back to Ruby in a serious way. Imagine Ruby's future if most companies that benefit from it make a similar tithe. That sure has paid off in terms of open source, e.g. Rails et. al. If that community also collectively finances teams of researchers the ROI should be similarly worthwhile. Integrating contributions into GitHub seems like a good direction.
- ekvintroj 4y agoRuby is one of the greatest programming languages alive. It is nice to see Shopify pushing it!
- itsTyrion 4y agoIt's also really slow so idk if I'd use it at a large scale..
- weatherlite 4y agoWhat a great company, too bad I bombed that interview lol damn cat
- pineconewarrior 4y agoOof. Give it another go in a year!
- vladcodes 4y agoDon't. It's not that amazing.
- weatherlite 4y agoProbably mostly in my head. But working on core Ruby or Rails is a dream of mine...curious though what's your experience like there?
- pineconewarrior 4y agoNowhere is amazing, really. Shopify would still be a fantastic career move for most people in terms of resume clout and income. Plus I was just trying to be nice!
- anitil 4y agoWhat did the cat do?
- weatherlite 4y agoIt's on me really, I made the huge mistake of taking the interview when my child was sick and my super loud father in law and wife were in the house with my toddler child. It was after the interview was postponed twice and I didn't want to postpone it again. In addition to all the noise they made the cat hated it that I closed the door during the interview and kept meowing to be let in...if I had let her in she would have kept bumping into me but in retrospect that would have been better. The icing on the cake was I took a room in the house that had a lousy connection so I was disconnected twice during the Leetcode thing (I don't remember if it was Leetcode but it was one of those online coding platforms). It was such a disaster it was the first time ever I asked to stop the interview in the middle - I just gave up and was a complete sweaty mess lol. So lesson learned - important interview needs to be in an empty house. I don't have a great solution for the cat problem. Anyway I usually don't take interview failure that hard but this one was painful because my performance was so embarrassing and I cared about the job. Probably my poor performance was in direct proportion to how excited I was about the opportunity - too bad.
- SemanticStrengh 4y agoI wished more companies would improve the world
- pineconewarrior 4y agoShopify has made great efforts to improve its ecosystem and developer experience. I am so glad they do!
- mikebenfield 4y agoI've always been fascinated by this phenomenon, which one can also see in the Lua and Python communities: Use a language whose natural implementation is extremely slow, and then invest enormous amounts of time and effort to make it fast. Why not just use a language whose natural implementation is already pretty fast? While I understand the value of some dynamic language features, many of the features of dynamic languages that are hardest to make fast are undesirable in any code base larger than a 50 line script anyway.
- 0des 4y agowalmart and a few others did this with node back in the 0.10 days, except iirc it was them that was holding up node at that version. iirc when iojs forked off, they had a much faster release schedule, and then at some point rejoined the main node project which then proceeded at a much faster rate. Was it also nike and paypal? I remember it being walmart and some others that were big champions of node in the beginning.
- bin_bash 4y ago> iirc it was them that was holding up node at that version really? I thought it was Joyent? Would love a source on this.
- 0des 4y agoyeah sorry about that, thats just off the top of my head. it was a wild time for me, so the events happening at the time coincided with me reading about the whole debacle live as iojs was happening.
- russtrotter 4y agoYours is a fair question. Theories: * Cheaper to invest in your tools than overhauling your people/codebases/etc * Sense of wanting to give back to your core tooling * The decision maker(s) for the investment just really love Ruby?
- 4y ago
- nullbytesmatter 4y agoTo be fair, investing half a million is nothing if it results in the improvements they want. It would be far costlier to rebuild infrastructre, train and shape a culture around another technology stack in an already monoculture company like Shopify.
- deleted 4y ago[deleted]
- dwheeler 4y agoIt doesn't seem to be mentioned here, but I'm especially intrigued by the possibility of implementing shaped objects. See https://chrisseaton.com/truffleruby/rubykaigi21/ https://chrisseaton.com/truffleruby/rubykaigi21/ and the previous HN conversation here: https://news.ycombinator.com/item?id=28476654 https://news.ycombinator.com/item?id=28476654 Shaped objects (aka Self's maps or JavaScript hidden classes) are an old idea, but they seem to have been only recently rediscovered, and the basic idea suddenly allows a lot of other potential optimizations (where research would be helpful). We don't know if they'd really improve Ruby performance, but I think it's very likely & I suspect they'd also enable future improvements.
- byroot 4y agoIt's in the works: https://bugs.ruby-lang.org/issues/18776 https://bugs.ruby-lang.org/issues/18776
- AlwaysRock 4y agoPretty cool. Interesting approach instead of just building applications that need high performance in Go/whatever other fun language enterprise rails companies have shifted to.
- the_sleaze9 4y agoLove it. Great work Shopify
- lowwave 4y agowhy does shopify not just use Crystal https://crystal-lang.org https://crystal-lang.org, it is faster than go, with Ruby like sytnax. Invidious the youtube proxy is written in it.
- chrisseaton 4y agoWe have a code base already written in Ruby.
- fknorangesite 4y agoYes, "just" port ~16 years' worth of Ruby. No sweat.
- stjohnswarts 4y agoTrivial.
- viraptor 4y agoBecause that would require porting all their code. The syntax is similar, but they're different languages (and I'm saying that as a person usually mentioning they're not that different). At their scale even updating to a new minor version of Ruby and fixing all warnings is likely a multi-day adventure. Moving to different Ruby runtime would take weeks/months. Moving to crystal would be effectively a rewrite from scratch.
- pmarreck 4y agoElixir: Exists (for further detail, see this comment and its parent: https://news.ycombinator.com/item?id=31402949 https://news.ycombinator.com/item?id=31402949)
- cultofmetatron 4y agosince facebook named their optimized php compiler "hip hop" can we call this optimized ruby compiler "reggaton" All jokes aside, they should get in contact with teh guys at gemstone software. I remember there was work on a highly optimized ruby vm called "maglev". I wonder whatever happened to that.
- weatherlite 4y agoIt's a JIT, it's not gonna affect Ruby syntax at all. Hip Hop got a new syntax, was forked and is basically a different language than PHP now.
- pragmatic 4y agoHow popular is Ruby these days? I haven’t paid much attention but the “optimize ruby” posts seemed to be much more common 5-10 years ago. Makes me wonder if devs just moved to node/python in the meantime?
- brodock 4y agopeople learned how to scale, not a big deal unless you are handling 1/3rd of the internet traffic for a specific industry.
- vladcodes 4y agoBasically, what you are reading here is the marketing bs. Shopify would better invest in MRI silently. TruffleRuby? Don't be shy; just call it ShopifyRuby — the board sure like it.
- rurban 4y agoI thought they already had yjit, which is much much better these folks were doing years ago. Looks more like a big namedropping event to get better yjit buy-in from ruby-core
- chrisseaton 4y agoNo, YJIT is separate to this, as the article says. This is about the new garbage collection effort, a new option for a JIT, and making interpreters faster.
- AzzieElbab 4y agoOne can write Scala like ruby or python or typescript nowadays. What seems to be the problem?