Live data from Hacker News

From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

shopify.engineering

101–109 of 109 posts

Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

#101

> ”Go and Rust allow distributing a static binary, but at the cost of fewer people at Shopify being inclined to contribute due to the lack of familiarity with the language.” If learning a language as simple as Golang is a real barrier for Shopify engineers, then I’d say they need to reevaluate their hiring processes. Especially given that they’re talking about CLI apps as opposed to something like distributed systems…

Is golang really that easy to get started with?

Easy to learn, hard to master.

Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

#102

I don't understand going from Ruby to JS. Go or Rust sure, but Node for CLI? What is gained by doing that lateral move?

it's in the article: "Hydrogen developers expect the npm install command to resolve all the dependencies that they need to work on a project. With Ruby as a dependency, that mental model breaks and they can easily run into issues where the CLI refuses to run because of additional steps needed."

Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

#103

> ”Go and Rust allow distributing a static binary, but at the cost of fewer people at Shopify being inclined to contribute due to the lack of familiarity with the language.” If learning a language as simple as Golang is a real barrier for Shopify engineers, then I’d say they need to reevaluate their hiring processes. Especially given that they’re talking about CLI apps as opposed to something like distributed systems…

I work somewhere with plenty smart engineers, and plenty of in-house golang expertise. I've seen several small internal tools rewritten from Python to Go, and contributions by the wider team totally dropped off. It used to be absolutely trivial for anyone to make changes, and the "deployment" of such scripts was basically "get the code reviewed and merge it." Now there's a whole Bazel song and dance, compilation as p…

IMO the big advantage of languages like Go in this space is that you can ship a binary to your users and that will Just Work™. Shipping a Python tool tends to be significantly more complex either for your users who will have to set up Python + dependencies, or for your build (e.g. the Python AWS CLI just ships an entire Python environment, which is a "solution" of sorts I guess, but it's not very easy or simple to do).

I don't think Go has to increase more friction in the dev workflow, but it probably does require a little bit (one-time) more effort to get it right.

Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

#104

> ”Go and Rust allow distributing a static binary, but at the cost of fewer people at Shopify being inclined to contribute due to the lack of familiarity with the language.” If learning a language as simple as Golang is a real barrier for Shopify engineers, then I’d say they need to reevaluate their hiring processes. Especially given that they’re talking about CLI apps as opposed to something like distributed systems…

Is golang really that easy to get started with?

I've been looking into Go, but two old colleagues of mine that use it basically turned me off on it. The amount of complaints I hear about quirks and things that take more time than other languages make me not want to pick it up.

Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

#105

I don't understand going from Ruby to JS. Go or Rust sure, but Node for CLI? What is gained by doing that lateral move?

it's in the article: "Hydrogen developers expect the npm install command to resolve all the dependencies that they need to work on a project. With Ruby as a dependency, that mental model breaks and they can easily run into issues where the CLI refuses to run because of additional steps needed."

If the bulk of their cli users are already node users/devs then that actually makes perfect sense.

Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

#106

I'm begging you, just use a language that compiles to a single binary. It can self update in place, be easily installed on developer machines and CI pipelines without requiring a whole additional toolchain in every container. Google, Heroku, AWS, Shopify all do and it's an awful developer experience.

What's the mechanism for self-updating in place? Something more intelligent than just downloading and copying the file over itself? A running program itself is a copy of the file on disk, I think. So that sounds fine. But this still depends on getting permissions right though I think. Also, does a binary always know where it lives (across Win/Mac/Linux)?

[deleted]

Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

#107
post #12

I'm begging you, just use a language that compiles to a single binary. It can self update in place, be easily installed on developer machines and CI pipelines without requiring a whole additional toolchain in every container. Google, Heroku, AWS, Shopify all do and it's an awful developer experience.

> I'm begging you, just use a language that compiles to a single binary. It can self update in place Is there a library that does self updating in place for binaries? Go is the langage that comes to mind when talking about single binary, so maybe a go library?

Maybe check out https://github.com/keygen-sh/keygen-go? Let’s you add auto upgrades to any free or commercial Go app (with support for licensing too).

(I’m the founder of the licensing API.)

Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

#108
post #73

Earlier quoted context omitted.

My read on this is they just wanted to cut out Ruby and do everything in Node. That's fine as a decision, but rest of the article feels like just trying to justify it after the fact. Like someone at the top decided, now lets pretend it's a good decision. As you mentioned, if they're not OK with CLI, they could refactor in Ruby. The whole "embracing functional programming" and MVC architecture (i think Rails when i he…

This might be the first article I've read where Node's module resolution algo is touted as a benefit. Just how complex is your command line app if you need to have multiple transitive versions of the same library? Coming from the same company that is so heavily invested in Ruby that they contributed to a new JIT for it (YJIT), built a static type checking layer (sorbet) for it, and built a module system that prevents…

Minor note, Sorbet was written at Stripe.

Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

#109
post #91
post #87

Earlier quoted context omitted.

I seem to recall reading recently that Go was showing up in their org. May be mistaken or misremembering.

We’ve been using Go since 2013. We recently started using Rust, but it’s mainly eating away at Go’s usage rather than Ruby’s. Ruby continues to be our first-choice language for most problems.

Thanks for the clarification, I appreciate it!
Post reply on HN