mackuba,
@mackuba@martianbase.net avatar

Current status: I opened about 100 links to articles and threads from Google results comparing , and and I'm planning to read them 🫠

(no, I'm not really considering Go, mostly just trying to convince myself that I'm not making a mistake starting to learn Rust and not Go 🦀😛)

alexanderadam,
@alexanderadam@ruby.social avatar

@mackuba maybe you want to add @CrystalLanguage to that comparison list? 🥹

mackuba,
@mackuba@martianbase.net avatar

@alexanderadam @CrystalLanguage Eh… I wanted to start using Crystal for a long time, but tbh, if I'm gonna learn a different language (similar, but still) and frameworks, switch to a compiling workflow etc., then I could as well just bite the bullet and learn a harder one that is even faster (Rust and Go seem to be quite far ahead of Crystal in benchmarks, especially Rust)... it didn't do well in that regex test I did either. And both have a bigger community, more libraries etc.

mackuba,
@mackuba@martianbase.net avatar

@alexanderadam @CrystalLanguage And I'm still gonna keep using Ruby for most backend/scripting things that don't require high performance, because that's what I know best and can build things quickly with.

alexanderadam,
@alexanderadam@ruby.social avatar

@mackuba @CrystalLanguage the community aspect is true for sure but performance-wise Go isn't faster. They're more or less the same. Some benchmarks are faster in each of them. The problem is that both of them use a garbage collector.

The compile workflow thing can't be an argument if you decide to add Rust or Go to your stack. Because they need to be compiled too.

But if you keep Ruby anyway, then Crystal would be a perfect fit if you'd consider Go a viable option as well.

alexanderadam,
@alexanderadam@ruby.social avatar

@mackuba @CrystalLanguage Rust is more efficient during the runtime but it also takes more development and maintenance time.

So all in an Go doesn't bring anything to the table except a bigger community.
Rust is faster but also brings more development overhead.
Crystal delivers Go performance with Ruby development speed.
The only disadvantage is that the community is not as big.
That is all.

mackuba,
@mackuba@martianbase.net avatar

@alexanderadam @CrystalLanguage Yeah, I've mostly ruled out Go from the beginning, I was just checking it out out of curiosity because the folks at Bluesky are using it for some more performance-critical server stuff (vs. Node/TypeScript that other stuff is written in).

(But I've just seen someone from the team post yesterday that it was using a lot of memory and spending most of the time on GC…)

mackuba,
@mackuba@martianbase.net avatar

@alexanderadam @CrystalLanguage I guess… I was already thinking about building a couple of pieces independently in Ruby and Rust and compare the performance on something larger than one function… I suppose I could try to throw in Crystal to the mix too 😅

brettwitty,
@brettwitty@mstdn.social avatar

@mackuba
What would "making a mistake" look like?

I'd be keen to hear your impressions. I love comparative explorations.

mackuba,
@mackuba@martianbase.net avatar

@brettwitty Putting in the time to learn something that could end up being not the best option for the things I need.

I'm mostly thinking about server backend stuff where Ruby doesn't do well enough for some reason - either because there's too much processing to do, or because I want really fast response times / minimal overhead. Either as a replacement of Ruby for some parts or whole services, or to combine them somehow (e.g. by making native compiled modules for Ruby).

mackuba,
@mackuba@martianbase.net avatar

@brettwitty For now I needed to speed up a specific case of doing a huge number of regexp matches against pieces of text (posts), I tested several languages and Rust seemed to be the fastest at it, so with ChatGPT's help I managed to make a module for Ruby in Rust (not knowing Rust at all!) that I can call as a method and get a boolean return value back, and it works great.

mackuba,
@mackuba@martianbase.net avatar

@brettwitty But I'm thinking if I wanted to write some next service where I care about speed, if it would make sense to build it in Rust or a combination of Ruby + Rust, or maybe to learn Go instead.

I read that Go is better suited for server stuff, concurrency, handling and making requests etc., because it's easier to write that and the language is simple; and that Rust is for more low-level stuff and much harder to learn. But I don't really like Go's syntax and Rust fascinates me…

  • All
  • Subscribed
  • Moderated
  • Favorites
  • ruby
  • DreamBathrooms
  • cisconetworking
  • mdbf
  • everett
  • Youngstown
  • rosin
  • slotface
  • love
  • khanakhh
  • kavyap
  • ngwrru68w68
  • ethstaker
  • thenastyranch
  • magazineikmin
  • provamag3
  • modclub
  • cubers
  • InstantRegret
  • osvaldo12
  • Durango
  • GTA5RPClips
  • tester
  • normalnudes
  • Leos
  • tacticalgear
  • anitta
  • megavids
  • JUstTest
  • All magazines