News for hackers. Stuff that matters.
Re:Shopify invests in research for Ruby at scale by mikebenfield on Monday May 16, 2022 @02:16PM (#31401337)
I'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.
Re:Shopify invests in research for Ruby at scale by bin_bash on Monday May 16, 2022 @03:07PM (#31401927)
I don't think "fast" languages are automatically better, they have downsides for sure:

* Rust - I do not understand the borrow checker at all and I'm a senior engineer at FAANG. I can barely write a simple function in Rust. I've struggled more learning Rust than any language (and I can write C and C++ just fine!)

* Go - I like Go, but there is a ton of boilerplate involved with writing it. Ruby is far more concise and you can get straight to business logic.

* Java - Even more boilerplate

* C/C++ - I think Ruby clearly wins on productivity here

Re:Shopify invests in research for Ruby at scale by pizza234 on Monday May 16, 2022 @04:27PM (#31402780)
Gitlab split and rewrote some services in $faster_language. Based on the hires, Github seems to be doing that as well.

Gitlab's history with $faster_language has at least some background documentation, e.g. https://about.gitlab.com/blog/2016/04/12/a-brief-history-of-....

They seemed to have liked it, as at least a couple of other services are written in $faster_language - gitlab-shell and gitaly (probably, several others).

There may be more static languages nowadays, but they're very young - I think in real world, there wasn't, pragmatically, a lot of choice, although today's young languages are... still young :)

Re:Shopify invests in research for Ruby at scale by bin_bash on Monday May 16, 2022 @04:37PM (#31402861)
I prefer Go to Ruby so I don't know what you're trying to argue. I just said it requires a lot of boilerplate and that makes it harder to be productive. Technology choice is about trade-offs.

It doesn't mean a project is doomed simply because it chose Go. That said, Heroku tried to do a major Go rewrite of their entire backend and the project failed miserably.

Re:Shopify invests in research for Ruby at scale by melony on Monday May 16, 2022 @05:46PM (#31403522)
What's the story behind Heroku's rewrite?
Re:Shopify invests in research for Ruby at scale by bin_bash on Monday May 16, 2022 @06:03PM (#31403685)
Re:Shopify invests in research for Ruby at scale by vips7L on Monday May 16, 2022 @09:57PM (#31405227)
IMO Go has far more boiler plate than Java. Go is going to have countless amounts more boiler plate for simple logic. Just like your comment below try writing one of these in go:

    var lst = users.stream()
        .filter(User::isAdmin)
        .map(u -> u.id() + “ : “ + u.name())
        .limit(10)
        .toList();


    static boolean isPrime(int n) {
        return switch (n) {
            case 0, 1 -> false,
            default -> !IntStream.range(2, n).anyMatch(i -> n % i == 0)
        }
    }
Re:Shopify invests in research for Ruby at scale by weatherlite on Tuesday May 17, 2022 @05:34AM (#31407990)
New Java is pretty damn good actually, I don't see a real need for Go over it other than compile time perhaps.
Re:Shopify invests in research for Ruby at scale by petercooper on Tuesday May 17, 2022 @06:25AM (#31408376)
Java has a lot going for it but the JVM remains anathema to a lot of developers. Modern C++ has similar stigma on the language end – it's possible to write fantastically expressive and terse code in it nowadays, but it maintains a reputation.
Re:Shopify invests in research for Ruby at scale by bin_bash on Tuesday May 17, 2022 @10:40AM (#31411393)
2 years ago I spent 2 months learning C++ coming from almost entirely scripting languages throughout my career. (Though I have a CS degree so a decent academic background in memory management)

I came away liking C++ more than I thought I would. I didn't find it hard to learn but it was time consuming. Where learning Rust I never understood the basic concepts enough to be productive, I could be productive pretty quick with C++.

The trouble is there is a lot to learn because the language is just so old and has been through so many revisions. To some extent you can't just limit yourself to the modern stuff since in order to learn the modern stuff you need a basic understanding of what it was before to know why things are done the way they are now. You also run into code samples that use the old stuff or corner cases where they're needed.

I also think it really gets you to think about how computation and memory is happening at the metal level which is great for optimization but I think for most of the work I do it would be largely a distraction. I see this is a downside, not an upside.

That said, you're definitely right. You can have nice, expressive code in C++: I just think the learning curve is the biggest problem. I'd be happy to use C++ in my next project though.

Re:Shopify invests in research for Ruby at scale by vips7L on Tuesday May 17, 2022 @10:59AM (#31411687)
Javac is still probably going to compile faster than go. Javac doesn't have to do ANY optimizations. I doubt you'll find a compiler faster.
Re:Shopify invests in research for Ruby at scale by bin_bash on Tuesday May 17, 2022 @04:14AM (#31407411)
You may be right. My knowledge of Java is from 1.4 in college and vastly out of date.

I should spend some time actually learning modern Java and less time avoiding it.

Re:Shopify invests in research for Ruby at scale by vips7L on Tuesday May 17, 2022 @09:33AM (#31410327)
There's still some verbosity. I would kill for C# like properties for mutable data classes (JPA entities). I also really like Kotlin/Scala style apply functions for interfaces and Kotlin's delegates for making easy decorators, but none of these have ever convinced me to leave Java behind. The only languages that have come close are C# or D because of their lower level capabilities.
Re:Shopify invests in research for Ruby at scale by musabg on Tuesday May 17, 2022 @03:41AM (#31407197)
Second one in Go:

    func IsPrime(n int64) bool {
        return big.NewInt(n).ProbablyPrime(0)
    }
Each language has its own pros and cons. Go wants to be explicit and simple to be understood. Java is fully-featured.

This is just anectodal evidence anyways. And these are tools in the and, and no point for a "tool fight".

Re:Shopify invests in research for Ruby at scale by vips7L on Tuesday May 17, 2022 @09:42AM (#31410464)
The point of that example wasn't to show if there was a standard library function for it. It was to show the verbosity of writing code that contains if conditions, loops, and generic programming. I obviously could have written:

    new BigInteger(n).isProbablyPrime(0);
Re:Shopify invests in research for Ruby at scale by bin_bash on Tuesday May 17, 2022 @10:29AM (#31411220)
My general point is that if you put Ruby up against a nonspecific compiled language it's hard to argue Ruby is better. When you analyze something like Go vs Ruby or Go vs Java then the warts of particular languages come out.
Re:Shopify invests in research for Ruby at scale by benhoyt on Monday May 16, 2022 @04:46PM (#31402947)
This is definitely true, and I wouldn't fault anyone for using Ruby or Python to write the initial version of their startup. However, there's a difference between initial productivity and ongoing productivity (maintenance). Statically typed languages like Go and C++ are much easier to rework and refactor, because the compiler is checking types (not to mention typos).
Re:Shopify invests in research for Ruby at scale by bin_bash on Monday May 16, 2022 @05:04PM (#31403123)
That's why my language of choice is TypeScript, but I think Sorbet looks promising (haven't used it though)
Re:Shopify invests in research for Ruby at scale by nazka on Monday May 16, 2022 @06:00PM (#31403656)
Same. Next whatever startup or what I will do will be done in TypeScript(/JS) for the back end and front end. The ecosystem is so massive. And most of the time people will do a library, tool, database, or whatever, and the next language they will support to interact with it is JS/TS.
Re:Shopify invests in research for Ruby at scale by bin_bash on Monday May 16, 2022 @06:11PM (#31403736)
make sure you give Deno a test run too. I think it could be great for some applications already.

(Specifically cases where you want the project easy to jump into with almost no toolchain setup.)

Re:Shopify invests in research for Ruby at scale by jiggawatts on Monday May 16, 2022 @06:48PM (#31404008)
C# and F# have a good blend of performance and code style.
Re:Shopify invests in research for Ruby at scale by TowerTall on Monday May 16, 2022 @09:20PM (#31404937)
And in Visual Studio (full, not code) you have an amazing IDE that is an incredible help when writing the code.
Re:Shopify invests in research for Ruby at scale by lowwave on Monday May 16, 2022 @04:09PM (#31402603)
why not just use Crystal https://crystal-lang.org, it is faster than go, with Ruby like sytnax.
Re:Shopify invests in research for Ruby at scale by JeremyNT on Monday May 16, 2022 @05:51PM (#31403562)
One major selling point of Ruby is the robust ecosystem of high quality, open source libraries which are relevant to the things SaaS companies need to get done. There's a ton of code you just don't have to write if you stick to Ruby.

The fact that "Ruby developers already basically know the Crystal syntax" is a selling point for Crystal, but if people are already evaluating a switch to another programming language, that's just one of many factors that must be considered.

Re:Shopify invests in research for Ruby at scale by chrisseaton on Monday May 16, 2022 @04:30PM (#31402798)
> with Ruby like sytnax

People use Ruby because they like the way it works, not because of the syntax.

Re:Shopify invests in research for Ruby at scale by petepete on Monday May 16, 2022 @08:00PM (#31404473)
Crystal's standard library is also a close match for Ruby's. I do Ruby every day and was able to familiarise myself with Crystal in a few hours.

It's definitely lacking in the web ecosystem department but the language is a joy to use and incredibly fast.

Re:Shopify invests in research for Ruby at scale by chrisseaton on Monday May 16, 2022 @08:04PM (#31404499)
It can be a 99.99% close-match, but if it doesn't include key methods like a runtime method_missing, then it's hard to see how we'd reimplement Rails and our code base on top of it.

I think people focus on the superficial similarity of Crystal, without thinking what semantics need to be the same for it to use usefully similar. And those semantics aren't there, so it doesn't matter if it sorts of looks the same and includes most methods.

I feel like if it was tractable to run Rails on Crystal then someone would have done that.

Re:Shopify invests in research for Ruby at scale by bin_bash on Monday May 16, 2022 @04:18PM (#31402689)
I'm waiting until I hear some success people are having with it. I suspect the ecosystem is young and library support is minimal too.

Last I heard (which was years ago) it was pretty much a solo project.

That said, the demo is really something and I like what they're doing. I hope one day it becomes my language of choice.

Re:Shopify invests in research for Ruby at scale by mosen on Monday May 16, 2022 @03:38PM (#31402274)
What about C#? That being said, I might just be accustomed to all the boilerplate.
Re:Shopify invests in research for Ruby at scale by bin_bash on Monday May 16, 2022 @03:43PM (#31402319)
Biggest downside is you're likely committing yourself to the Microsoft stack and a single vendor for most of your technology.

I don't think it's necessarily the wrong decision but you have to decide if it's right for your project.

Re:Shopify invests in research for Ruby at scale by seabrookmx on Monday May 16, 2022 @03:49PM (#31402380)
Dotnet core runs fine in Docker/on Linux?

Most C# apps I've worked on in the last 5 years are deployed to Kubernetes.

Re:Shopify invests in research for Ruby at scale by bin_bash on Monday May 16, 2022 @03:55PM (#31402449)
fair enough, perhaps I should give it another look
Re:Shopify invests in research for Ruby at scale by GiorgioG on Monday May 16, 2022 @03:54PM (#31402439)
100% inaccurate/outdated (by 5 years) info. I've run .NET Core applications on Linux/Docker/K8s + Postgres. The only Microsoft 'stack' there is .NET itself.
Re:Shopify invests in research for Ruby at scale by Nullabillity on Monday May 16, 2022 @08:49PM (#31404763)
.NET Core is still absolutely designed to nudge you into the MS stack.

- EFCore is MSSQL first, even if other options are provided

- Many libraries ship with two implementations: an over-engineered Windowsy version that barely works (with a big scary warning that it should never be used in production), and a thin wrapper around some Azure service

- Important tooling like the debugger (which wouldn't be so necessary if .NET had halfway decent support for printf debugging, but here we are...) is locked to be compatible with VS and (MS' build of) VSCode, despite both of them using supposedly open (and Microsoft-pushed!) standards like DAP

- The community is really culty, the response to "X is broken when using the non-MS-Stack alternative" always seems to be "well use the standard MS solution then"

- It's practically open source in name only, because the build engineering is so convoluted that it's nearly impossible to find the canonical source code of core features like the standard libraries

Re:Shopify invests in research for Ruby at scale by GiorgioG on Monday May 16, 2022 @09:38PM (#31405078)
- EF Core is not MSSQL first. EF Core is an abstraction layer and is in no way tied to Sql Server. In fact, Microsoft's own getting started tutorial uses Sqlite (1). I've personally used the Postgres drivers in production and they are as good/production-ready as Microsoft's SQL library for EF Core.

- "Many libraries ship with two implementations..." I've yet to come across these "many" libraries in the 5 years since I've been building services with .NET Core.

"The community is really culty" - I'm not sure where this is coming from. It's hard to refute such vague criticisms.

- "It's practically open source in name only" - Here is the base class library source: https://github.com/dotnet/runtime/tree/main/src/libraries or https://github.com/dotnet/corefx/releases (depending on what version you're looking for)

1. https://docs.microsoft.com/en-us/ef/core/get-started/overvie...

Re:Shopify invests in research for Ruby at scale by GiorgioG on Monday May 16, 2022 @09:59PM (#31405249)
If you want to build .NET Core yourself, Microsoft provides you with the steps necessary to do so here: https://github.com/dotnet/source-build

Maybe our definitions of open source are different, or maybe you're just shitting on Microsoft for your own reasons. Regardless of whatever your experiences have been with .NET in the past, they don't mirror the majority of the folks that use it everyday.

Re:Shopify invests in research for Ruby at scale by hoofhearted on Tuesday May 17, 2022 @12:28AM (#31406039)
.Net Core is universal platform. Our API servers run .Net Core exe’s on Ubuntu behind NGINX. Full AWS stack, some Google Cloud and Mongo Cloud services internally. I don’t think we even have an Azure account.
Re:Shopify invests in research for Ruby at scale by carlivar on Monday May 16, 2022 @03:43PM (#31402321)
Still a lot of Windows baggage with C#. It's changing, but I think most c# devs are still learning fundamental unix and docker stuff. So you'll get an overhead with C# too, just not in technical performance.
Re:Shopify invests in research for Ruby at scale by GiorgioG on Monday May 16, 2022 @03:52PM (#31402408)
Source? As a .NET developer I can tell you that there are plenty of us with Linux/Docker experience. There is zero Windows baggage with C# in .NET (Core). Your information is out of date.
Re:Shopify invests in research for Ruby at scale by pjmlp on Tuesday May 17, 2022 @02:30AM (#31406723)
Projects making use of Sitecore, Dynamics, SharePoint, SQL Server CLR,... GUI frameworks out of Redmond

Graphical tooling to deal with process dumps, etw data, and profiler information only available on VS.

Re:Shopify invests in research for Ruby at scale by GiorgioG on Wednesday May 18, 2022 @12:23PM (#31424652)
> Projects making use of Sitecore, Dynamics, SharePoint, SQL Server CLR,

What projects? None of those are forced on you or have any references to them built into .NET Core. I've been building .NET apps since 1.0 reached beta (in 2001?) I can count on one hand how many times in total that I've worked with those systems. This argument is a hell of a reach.

> GUI frameworks out of Redmond The upcoming Microsoft MAUI is cross-platform (no, Microsoft isn't building support for Linux, but there are open source efforts working on it.)

You can use https://avaloniaui.net or https://platform.uno

> Graphical tooling to deal with process dumps, etw data, and profiler information only available on VS.

https://www.hanselman.com/blog/dotnettrace-for-net-core-trac...

There's also https://github.com/SachiraChin/dotnet-monitor-ui

You can use JetBrains rider to profile in Linux/MacOS as well: https://www.jetbrains.com/help/rider/Profiling_Applications....

If you don't want to use .NET, you obviously don't have to.

Re:Shopify invests in research for Ruby at scale by carlivar on Monday May 16, 2022 @04:08PM (#31402590)
I work for a C# shop. However maybe the signal is ex-Microsoft rather than C# itself, when I think about it more. We have lots of ex-MSFT.
Re:Shopify invests in research for Ruby at scale by lovich on Monday May 16, 2022 @08:10PM (#31404542)
Switched from a career of a windows/.net/c# to a max/ruby/js shop. Docker skills transferred. Had to learn Unix commands but it didn’t feel much different from cmd/powershell
Re:Shopify invests in research for Ruby at scale by pharmakom on Monday May 16, 2022 @06:51PM (#31404036)
You could make most scripting languages much faster by adding immutable structs and keeping everything else more or less the same. There was a game middleware company selling more or less this for Lua.
Re:Shopify invests in research for Ruby at scale by exabrial on Monday May 16, 2022 @04:00PM (#31402521)
Prove Productivity scientifically.
Re:Shopify invests in research for Ruby at scale by bin_bash on Monday May 16, 2022 @04:21PM (#31402714)
We gonna double-blind developers or something? I know Go and Ruby very well. I know what it takes to write in one vs the other.

Ruby is faster to write and more concise by a long shot—certainly if we're talking back-end web services. I prefer Go to Ruby generally but it's weird that Go developers tend not to even see how much yak shaving is involved with it. Or really any downside with it.

Try writing this in Go:

    records = User.limit(10)
    records.select { |user| user.is_admin? }.map{|user| "#{user.id} : #{user.name}"}
Re:Shopify invests in research for Ruby at scale by pjmlp on Tuesday May 17, 2022 @03:00AM (#31406921)
Thanks to generics, assuming there is some stream/sequence like type

    records := Stream.Limit(User, 10)
    records.Select(func(user User) bool {return user.IsAdmin()}).Map{func(user User) string { return fmt.Sprintf("%d %s", user.id, user.name) }
Yes a bit more verbose, that is the price to pay for static typing without full type inference as in the ML language family.
Re:Shopify invests in research for Ruby at scale by bin_bash on Tuesday May 17, 2022 @04:24AM (#31407476)
It blows my mind why Go didn’t have generics at launch. I suppose they just didn’t want people to be able to have abstractions like this at all?
Re:Shopify invests in research for Ruby at scale by pjmlp on Tuesday May 17, 2022 @04:33AM (#31407537)
> In retrospect, we were biased too much by experience with C++ without concepts and Java generics. We would have been well-served to spend more time with CLU and C++ concepts earlier.

https://go.googlesource.com/proposal/+/master/design/go2draf...

Re:Shopify invests in research for Ruby at scale by bin_bash on Tuesday May 17, 2022 @05:03AM (#31407728)
oh wow thanks for this. I haven't been actively using Go since around the time this was written so I've missed it
Re:Shopify invests in research for Ruby at scale by AzzieElbab on Tuesday May 17, 2022 @08:18AM (#31409394)
Stream.limit and Stream.select(…).limit are not the same thing :)

records.collect({case u if u.isAdmin => s”${u.id} ${u.name}”}).take(10) guess the language

Re:Shopify invests in research for Ruby at scale by pjmlp on Tuesday May 17, 2022 @09:23AM (#31410177)
Well you can argue semantics, it doesn't change the fact that it is possible to implement the same concepts in Go with generics.

That line of code could be Scala, or something else.

In any case, the point is that there are compiled languages that offer similar productivity like Ruby, with AOT/JIT compilers out of the box, and great IDE experiences.

Re:Shopify invests in research for Ruby at scale by AzzieElbab on Tuesday May 17, 2022 @11:49AM (#31412450)
It is Scala. I meant to demo type inference and pattern matching. I know pattern matching(something I cant live without) does not exist in Go and Ts, not sure how well type inference works in Go
Re:Shopify invests in research for Ruby at scale by howeyc on Monday May 16, 2022 @04:43PM (#31402921)
I may be wrong, but aren't you doing two loops by doing it that way? One for the select, and another for the map? Or does ruby compile out the select loop with smarts.

In Go, the intuitive way would be one loop with an if inside it. So it would be easy to spot this performance issue if you did it the ruby way with two loops.

https://go.dev/play/p/ixDKuosxPNp

I bet I wrote my for loop as quickly as you wrote your map. The character count isn't that much higher.

Re:Shopify invests in research for Ruby at scale by bin_bash on Monday May 16, 2022 @05:20PM (#31403257)
The amount of times in my career where the performance would be even measurable between these 2 styles is vanishingly few. If I cared I could just use #filter_map or a classic for-each loop. If we're assuming the project is written in Ruby in the first place, clearly we're not valuing performance that highly.

The more important thing is the ruby version is chainable and more readable—and that matters far more often.

Re:Shopify invests in research for Ruby at scale by gkop on Tuesday May 17, 2022 @12:19AM (#31405989)
You had me until

> more readable

Without having more context, User in your code is possibly an ActiveRecord class, so to read the #select, you have to consider that it could be radically different and heavier than Enumerable#select (eg. it may execute a DB query as a side effect). So I like your example still, because it’s representative, and certainly expressive, but not readable per se. IMO this sin here is simply that ActiveRecord shouldn’t have overloaded select.

Re:Shopify invests in research for Ruby at scale by bin_bash on Tuesday May 17, 2022 @04:23AM (#31407462)
That’s more of an argument against ORMs which I realize my example used. I was mostly trying to convey using map/filter against POROs though.

Using an ORM was a poor choice on my part. I agree the magic there does harm readability since it makes it a lot harder to understand what it really is doing.

Re:Shopify invests in research for Ruby at scale by Lio on Wednesday May 18, 2022 @10:13AM (#31423040)
Ruby has had lazy iteration[1] for quite a while but as n here is only 10 there's really not much to loose in not using it.

In fact given that only a subset of users will be admin users for the second loop n is going to < 10 anyway.

I believe it was Rob Pike that actually said something along the lines of not bothering to optimise until you know that n is large[2].

1. https://ruby-doc.org/core-2.5.0/Enumerator/Lazy.html

2. https://users.ece.utexas.edu/~adnan/pike.html

Re:Shopify invests in research for Ruby at scale by kaba0 on Tuesday May 17, 2022 @05:14AM (#31407830)
Not sure about Ruby, but Java’s streams would do one loop only here, as they are lazy. Also, both solutions are O(n), so unless this is the hot loop of your program, or it iterates over some insane amount of entities, it is a completely meaningless microoptimization.
Re:Shopify invests in research for Ruby at scale by DoctorOW on Monday May 16, 2022 @04:01PM (#31402539)
Why?
Re:Shopify invests in research for Ruby at scale by exabrial on Monday May 16, 2022 @04:21PM (#31402712)
Because it underpins the argument above.

If Ruby is "so productive", that's a quantifiable measurement, no?

Re:Shopify invests in research for Ruby at scale by zrail on Monday May 16, 2022 @03:05PM (#31401912)
Shopify was founded in 2006 and I'm sure (having never worked there) there are things in their codebase that are that old.

What were the options in 2006 for languages with both a fast runtime and reasonable DX? I honestly can't think of any. Ruby at the time was pretty far ahead on DX for mainstream and up and coming languages. It was known to be slow but DX for Java was really not great and mired in "enterprise" features and mindset.

Edit: python was of course around and I don't remember the Django timeline well enough to say if it was viable in 2006 or not. PHP was of course around but again there was a mindset issue at the time.

Re:Shopify invests in research for Ruby at scale by cultofmetatron on Monday May 16, 2022 @03:09PM (#31401951)
cough common lisp cough
Re:Shopify invests in research for Ruby at scale by zrail on Monday May 16, 2022 @03:18PM (#31402052)
Sure. Not exactly mainstream so one would need to consider the hiring pipeline, but if it serves as a competitive advantage then sure.
Re:Shopify invests in research for Ruby at scale by rurban on Tuesday May 17, 2022 @03:14AM (#31407008)
You definitely don't need to consider a hiring pipeline with Common Lisp. 1-2 people are enough to write and maintain it.

But if you prefer 500 devs instead you should consider ruby, python or PHP. Middle managers are getting high on these numbers.

Re:Shopify invests in research for Ruby at scale by kaba0 on Tuesday May 17, 2022 @05:30AM (#31407965)
Honestly, that’s just bullshit. Every language is more productive with fewer developers since communication does have an inherent cost. But there is no Silver bullets as per the famous article, no language provides not even 2fold increase in productivity over another managed one, let alone an order.
Re:Shopify invests in research for Ruby at scale by cultofmetatron on Saturday May 21, 2022 @07:47PM (#31463362)
while I agree a 500 fold increase is a bit of exaggeration, There is some merit to the argument.

more expressive languages including common lisp certainly give more power for an experienced engineer to outperform someone fresh out of univeristy. enough to say that I'd rather have 2-3 senior engineers experienced with common lisp or clojure or haskell over 10-15 juniors working on go or python.

and what if you gave them the same expressive language? I'd argue that its even more dangerous. Common lisp is a powerful language but its easy to code yorself into a corner if you don't have the experience to properly use it. it;d be easy to build overcomplicated systems that are brittle. go is in fact better for them because it limits the damage they can cause.

Re:Shopify invests in research for Ruby at scale by cultofmetatron on Monday May 16, 2022 @03:21PM (#31402094)
it was used to write viaweb back in the 90's. The original saas that made Ycombinator possible.
Re:Shopify invests in research for Ruby at scale by zrail on Monday May 16, 2022 @03:29PM (#31402179)
Ok but that still doesn't make it mainstream or have a candidate pool. If those things don't matter then anything goes.
Re:Shopify invests in research for Ruby at scale by closeparen on Tuesday May 17, 2022 @02:01AM (#31406533)
An underrated feature of obscure languages is that they alienate people who think “$tool developer” is a an identity.
Re:Shopify invests in research for Ruby at scale by yowlingcat on Monday May 16, 2022 @03:36PM (#31402248)
Where would the community, mindshare, and hiring pool be? Or would you have to innovate on how you come up with that (on top of your core product) to accomplish anything there?
Re:Shopify invests in research for Ruby at scale by cultofmetatron on Monday May 16, 2022 @04:55PM (#31403032)
community is small but extremely dedicated.

I agree that the hiring pool is small but if you want go level performance, metaprogramming and developer productivity, common lisp was your best option.

Shopify went with ruby. not a terrible language but it did come at teh cost of performance.

Re:Shopify invests in research for Ruby at scale by yen223 on Monday May 16, 2022 @05:30PM (#31403369)
A better question to ask is, why are these "slow" languages winning? If performance is as important as we think it is, why don't we see startups using Rust or whatever just running circles around startups using Ruby?

The answer to this will lead to what actually matters in a language, in terms of building a product. Raw performance isn't it.

Re:Shopify invests in research for Ruby at scale by nickjj on Monday May 16, 2022 @08:00PM (#31404474)
This is something I've thought a lot about over the years too.

Runtime performance is great and very much welcome if you can get it for free but for a ton of web apps it's not a major selling point on its own.

If I can write 30-100% less code and be able to Google almost every single problem I encounter and find tons of high quality blog posts, documentation and videos along with having decently maintained third party libraries for common features then this is going to win every time in my book against something that doesn't have this. It doesn't matter if your web app uses 100mb of memory instead of 1gb or can serve 300 requests per second instead of 30. Most apps never come remotely near the point where this level of performance matters and Rails makes it easy enough to cache things where you can get your p95+ responses responding in 50-100ms or less without much effort.

Basically Rails sets you up where a solo dev or small team can run an entire SAAS app on a single $20-40 / month server and have tens of thousands of paying customers without really having to think much about performance. Combine this with Hotwire and you can build really nice feeling sites very quickly if you're the type of person who doesn't want to build APIs + JS front-ends.

On the other side of the spectrum with Shopify, GitHub and Basecamp you have engineers running Rails at massive scale making the framework better for everyone (themselves included). It's a self-fulfilling prophecy and win / win scenario because the more people that use it contribute back to the project (patches, community related things, etc.).

At this point the only things that matter are fast how you can build your app and how happy are you building / maintaining it. As Ruby, Rails and compute resources get faster then frameworks who focus mainly on performance become less appealing over time for a huge class of web apps because once you reach "good enough" performance it's all about the community and mass adoption. It's like a company who pops up and tries to copy another company but adds 1 small feature to differentiate themselves. As soon as the company you copied decides to add that feature you're going to be climbing way up hill to barely survive.

Re:Shopify invests in research for Ruby at scale by clpm4j on Monday May 16, 2022 @06:49PM (#31404017)
One plausible reason in my mind is that startups tend to hire devs on the younger side, and it seems (from my perspective in the USA) that most new-ish grads come out of school having done most of their programming in Python. Plus some Javascript if they've dabbled in web dev building hobby projects.
Re:Shopify invests in research for Ruby at scale by hw on Monday May 16, 2022 @11:32PM (#31405767)
Ruby/Rails optimizes for developer productivity. Once you prove yourself as a company and your product reaches a scale where you cant just throw $$$ at the problem, you’d be in a good spot to then hire folks to start rewriting parts in $languageofchoice.
Re:Shopify invests in research for Ruby at scale by pjmlp on Tuesday May 17, 2022 @03:13AM (#31407006)
40 years ago those newly hires would have only learned BASIC.

Except at least BASIC had compilers available, and Darthmound BASIC was originally designed with what we call JIT nowadays, even if that wasn't a thing on 8 bit home computers.

Re:Shopify invests in research for Ruby at scale by erik_seaberg on Tuesday May 17, 2022 @04:35AM (#31407553)
Latency matters, but nobody’s platform is unusably slow. Expressiveness matters for morale and hiring, and most of all while iterating early on. Efficiency only starts to matter when product/market fit brings enough load to push your backend budget.
Re:Shopify invests in research for Ruby at scale by pull_my_finger on Monday May 16, 2022 @03:25PM (#31402141)
I think Lua is catching a stray here. For most uses, Lua, even the PUC-Rio/vanilla implementation, is pretty fast. LuaJIT is quite fast. And because Lua is an embedded language authors can defer to C or whatever the host language is for bottlenecks requiring more speed. IDK if people are seeking dynamic types specifically, but it sure is nice to have stuff like memory management + easy string manipulation built-in sometimes.
Re:Shopify invests in research for Ruby at scale by w1nk on Monday May 16, 2022 @03:53PM (#31402421)
Lua definitely caught a stray here. The reference VM is pretty fast, the JIT is just way faster. No idea how Lua ended up wrapped in the conversation with Python...
Re:Shopify invests in research for Ruby at scale by rurban on Tuesday May 17, 2022 @03:14AM (#31407014)
Lua has no OO, and changes its stdlib all the time.
Re:Shopify invests in research for Ruby at scale by wink on Tuesday May 17, 2022 @07:51AM (#31409083)
I have no idea what you're alluding to. Not only are many people on LuaJIT's api version anyway, I don't remember ever running into any meaningful stdlib change that wasn't easily fixed. And Lua not having OO isn't really a problem to most people either.
Re:Shopify invests in research for Ruby at scale by mountainriver on Monday May 16, 2022 @02:44PM (#31401664)
Yeah it’s an interesting point. Wrt Python, I’ve tried writing ML in many different languages for this exact reason, but at the end of the day community is everything.

Pythons community in the ML space is pretty incredible. Trying to recreate all the libraries in another language is no small task, then you also have the issue that Data Scientists don’t want to write in complex languages.

In events like this, improving the language can start to look like the best option.

Re:Shopify invests in research for Ruby at scale by skrtskrt on Monday May 16, 2022 @04:10PM (#31402615)
Agreed, as someone who has largely done web services in Python, along with some data engineering

I work professionally in Golang now and I appreciate so many things about it, but when I go back to get something done for a personal project in Python, it is scary how much faster I can move.

Pydantic, FastAPI, SQLAlchemy, Alembic, requests, attrs, click... it's going to be a long time before other languages can hope to provide libraries with developer experiences that even come close.

Re:Shopify invests in research for Ruby at scale by 0x008 on Monday May 16, 2022 @03:19PM (#31402066)
Because management want's to "get things done" and quickly "evaluate ideas", a dynamic and somewhat loose language is actually an advantage in prototyping. Also it is very easy to find new developers than for example if you'd use rust, because you can just hire any frontend dev.

tooling can be built with money and money is usually not the issue for these companies.

Re:Shopify invests in research for Ruby at scale by pizza234 on Monday May 16, 2022 @04:21PM (#31402711)
Splitting services and porting them to a faster language doesn't prevent prototyping in the main, slower, language (in this case, Ruby).

It also doesn't need to be microservices madness - see GitLab (and also GitHub, but I think they don't open source their internal services), which rewrote some parts in Go.

Re:Shopify invests in research for Ruby at scale by pjmlp on Tuesday May 17, 2022 @03:16AM (#31407027)
Dynamic and somewhat loose language doesn't preclude not having at very least JIT support out of the box, even BASIC was better in that regard.

And if we take into account Ruby's predecessors, Smalltalk, SELF, Dylan.

Re:Shopify invests in research for Ruby at scale by rileyphone on Tuesday May 17, 2022 @05:51PM (#31416709)
SELF was really fast, at least as claimed [0] - about half the speed of optimized C and quicker to compile. It was where the HotSpot tech for the JVM came from, and V8 uses a similar object model and thus techniques. Just wish they could have made it usable!

[0] https://bibliography.selflanguage.org/practical.html

Re:Shopify invests in research for Ruby at scale by igouy on Wednesday May 18, 2022 @12:18PM (#31424587)
afaict Self and Dylan were research projects / product development projects.

Smalltalk had multiple commercial implementations and was used to build mission critical software in banks and utility companies and manufacturing companies and…

https://www.davethomas.net/papers/ubiquitous1995.pdf

Re:Shopify invests in research for Ruby at scale by pjmlp on Thursday May 19, 2022 @03:16AM (#31431657)
Apple sold Dylan to Harlequin, which sold it as a DylanWorks for some time.

Smalltalk still has commercial implementations, like Cincom.

https://www.cincomsmalltalk.com/main/

Re:Shopify invests in research for Ruby at scale by carlivar on Monday May 16, 2022 @03:40PM (#31402287)
Precisely. Twitter is a great example of this. I'm sure they have moved beyond Ruby in many areas but it was originally core and got them off the ground quickly, I presume.
Re:Shopify invests in research for Ruby at scale by kaba0 on Tuesday May 17, 2022 @05:33AM (#31407984)
Isn’t twitter running on Scala with Graal nowadays?
Re:Shopify invests in research for Ruby at scale by russtrotter on Monday May 16, 2022 @02:36PM (#31401571)
Yours 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?
Re:Shopify invests in research for Ruby at scale by politician on Monday May 16, 2022 @02:44PM (#31401662)
Theory #4: The performance is actually fine, but the developers were given a project to improve performance in order to keep them around for hot fixes in a codebase they know well and to mentor junior employees.
Re:Shopify invests in research for Ruby at scale by wmfiv on Monday May 16, 2022 @04:08PM (#31402587)
Because you already have a $50B business that runs on the slow thing. So from a risk and cost/benefit analysis making the slow thing fast sounds a lot better than "rewrite everything".
Re:Shopify invests in research for Ruby at scale by mike_hock on Monday May 16, 2022 @05:22PM (#31403279)
More importantly, you had to hack shit together as fast as possible to get a dice roll at the $50B business or bust game.
Re:Shopify invests in research for Ruby at scale by gregors on Monday May 16, 2022 @07:59PM (#31404467)
Ruby is a helluva lot of fun and a lot of engineers at Shopify like it. Life isn't just about taking the shortest route sometimes.

One of my favorite quotes

> I think that it's extraordinarily important that we in computer science keep fun in computing. When it started out, it was an awful lot of fun. Of course, the paying customers got shafted every now and then, and after a while we began to take their complaints seriously. We began to feel as if we really were responsible for the successful, error-free perfect use of these machines. I don't think we are. I think we're responsible for stretching them, setting them off in new directions, and keeping fun in the house. I hope the field of computer science never loses its sense of fun. Above all, I hope we don't become missionaries. Don't feel as if you're Bible salesmen. The world has too many of those already. What you know about computing other people will learn. Don't feel as if the key to successful computing is only in your hands. What's in your hands, I think and hope, is intelligence: the ability to see the machine as more than when you were first led up to it, that you can make it more. Alan J. Perlis

Re:Shopify invests in research for Ruby at scale by scelerat on Tuesday May 17, 2022 @11:40AM (#31412312)
Time-to-market with a viable product is extremely important. In the case of Rails in particular, the developer experience is such that even a very green programmer (for example, an entrepreneur who has taken a class or two) can bootstrap a working proof of concept quickly. That alone can be worth whatever drawbacks the language "speed" is, and is partly why Rails (and python stacks) were and continue to be popular.

Also, language speed alone isn't a deciding factor if your bottlenecks are elsewhere: network latency, i/o etc.

Having a "fast" language, for many projects, is something you worry about only after achieve some kind of success, and that success is made more achievable by having good developer tools.

Re:Shopify invests in research for Ruby at scale by rsanek on Monday May 16, 2022 @11:17PM (#31405693)
The thing is, interpreted languages have a natural advantage vs. more performant, compiled ones when it comes to iteration speed (and also often ease of early deployment). I think the reason we see this is that while it would be great to pick a more performant language at the beginning, it may mean that your iteration speed is too slow and you simply don't survive as a company (run out of funding, can't pivot fast enough, etc.) In my mind, it's actually a very reasonable choice to start with what you think will be the most optimized for early developer productivity. Once you get to be a company worth tens of billions, you can just pay people to solve this problem for you.
Re:Shopify invests in research for Ruby at scale by yowlingcat on Monday May 16, 2022 @03:32PM (#31402213)
What does fast "natural implementations" mean? Runtime? Compile-time? Because if one sacrifices the latter for the former, I think that skirts over the main benefit.

With dynamic, interpreted languages that have effectively zero compile-time, one can achieve significantly tighter iteration cycles across a team, ending up limited more by test suite runtime than by slow edit/recompile cycles. This leads to higher productivity across an engineering organization with a quickly evolving codebase. Not important for all use cases, but pretty critical for many.

Re:Shopify invests in research for Ruby at scale by kaba0 on Tuesday May 17, 2022 @05:39AM (#31408038)
> effectively zero compile-time, one can achieve significantly tighter iteration cycles across a team

I don’t know what machines do people develop on, but on a fairly old laptop I get practically instantaneous iteration with incremental compiles with Rust, which is one of the slowest compiling languages. I honestly can’t imagine where is this supposed slow compiles in case of something like Java - like sure one can create some monstrosity of a build definition, but if some competent person wrote it it is just as fast as an interpreted language. Hell, it can do hot swapping just fine.

Re:Shopify invests in research for Ruby at scale by vorpalhex on Monday May 16, 2022 @02:42PM (#31401640)
This is why we have C bindings. Let performance things be performant and readable things be readable.
Re:Shopify invests in research for Ruby at scale by pjmlp on Monday May 16, 2022 @03:26PM (#31402155)
And in the process add a couple of CVEs...
Re:Shopify invests in research for Ruby at scale by vorpalhex on Monday May 16, 2022 @03:44PM (#31402335)
You don't need to stay in C. You can pop through to Rust or Golang or what have you.
Re:Shopify invests in research for Ruby at scale by kaba0 on Tuesday May 17, 2022 @05:35AM (#31407999)
Why do you put a high level managed language into the same category as one with a runtime and a GC? Like, why would you want 2 runtimes at the same time? Makes 0 sense.
Re:Shopify invests in research for Ruby at scale by vorpalhex on Tuesday May 17, 2022 @03:06PM (#31415071)
Which of those do you think is a high level managed language with a runtime aside from Ruby?

Both of those are comparable to C and compiled. Rust is a bit lower level, Golang a bit closer to C++.

Re:Shopify invests in research for Ruby at scale by kaba0 on Tuesday May 17, 2022 @03:42PM (#31415433)
C and Rust is obviously a low level language, as well as C++.

Go is the odd one in the list, you might as well say that one should write an external function in Java and call that from Ruby (which would be fair if Ruby would already run on the JVM, e.g. in case of TruffleRuby).

Go has nothing at all to do with C++, C++ is a low level language, and an expressive one at that. Go is neither of those, it is managed and not good at expressiveness (by design).

Re:Shopify invests in research for Ruby at scale by Lio on Wednesday May 18, 2022 @10:54AM (#31423557)
FYI Ruby does already run on the JVM since 2001 via JRuby.

There's no need to wait for TruffleRuby (unless you want to).

https://www.jruby.org/

Re:Shopify invests in research for Ruby at scale by kaba0 on Wednesday May 18, 2022 @11:52AM (#31424266)
Yeah, I’m aware, it was more just a tongue-in-cheek comment.
Re:Shopify invests in research for Ruby at scale by vorpalhex on Wednesday May 18, 2022 @11:30AM (#31424012)
Golang is a perfectly fine choice here for performance sensitive code in place of C when paired with a less performant language like Python.
Re:Shopify invests in research for Ruby at scale by kaba0 on Wednesday May 18, 2022 @11:49AM (#31424229)
Then add JS, C#, Java, Haskell etc to the list as well, they all perform roughly in the same ballpark.
Re:Shopify invests in research for Ruby at scale by pjmlp on Monday May 16, 2022 @04:02PM (#31402544)
Which begs the point why use Ruby at all, plenty of AOT/JIT languages with great IDE tooling to chose from.
Re:Shopify invests in research for Ruby at scale by bin_bash on Monday May 16, 2022 @04:31PM (#31402810)
You think Shopify should've written their backend in Rust? I really wonder if people saying this have ever used Rust.

Ruby is great for developers of all skill to learn and be productive.

Rust is fast as the devil but you have to be a damn good coder to learn it. Even then I doubt you can be as productive managing memory all the damn time. It's a low-level language great at low-level things.

Ruby is a great option for Shopify. Rust is a great option for Firefox's Servo (though that project failed so maybe not).

Re:Shopify invests in research for Ruby at scale by pjmlp on Tuesday May 17, 2022 @02:13AM (#31406619)
Where does "Plenty of AOT/JIT languages" imply Rust?
Re:Shopify invests in research for Ruby at scale by bin_bash on Tuesday May 17, 2022 @05:08AM (#31407770)
reading my comment from yesterday I don't know what I was thinking, apologies
Re:Shopify invests in research for Ruby at scale by brodock on Tuesday May 17, 2022 @11:48PM (#31419048)
cost of improving the language vs cost of hiring new people in different language, keep things stagnating for 10 years while rewrite is in progress, having to deal with talent exodus etc.
Re:Shopify invests in research for Ruby at scale by UncleOxidant on Monday May 16, 2022 @07:53PM (#31404440)
Also, if they want a faster Ruby why not invest in Crystal? https://crystal-lang.org/
Re:Shopify invests in research for Ruby at scale by 0des on Monday May 16, 2022 @02:21PM (#31401384)
walmart 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.

Re:Shopify invests in research for Ruby at scale by bin_bash on Monday May 16, 2022 @04:27PM (#31402776)
> iirc it was them that was holding up node at that version

really? I thought it was Joyent? Would love a source on this.

Re:Shopify invests in research for Ruby at scale by 0des on Tuesday May 17, 2022 @12:23AM (#31406013)
yeah 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.
Re:Shopify invests in research for Ruby at scale by itsTyrion on Sunday May 22, 2022 @09:45AM (#31468127)
I mean for Lua we at least have LuaJIT which is pretty fast.

But Ruby?