HACKER Q&A
📣 anonyfox

From Rust to Ruby?


I know this sounds backwards, but hear me out: I _loved_ programming in Ruby, especially metaprogramming and building DSLs and had great times building small GUI tools with Shoes (and doing Rails 2/3 ofc).

Currently I am loving Rust, especially the typesystem, performance, statically linked binaries (= no docker needed at my job) and the tooling.

Seems that these languages are polar opposites... but I really want back the creative superpowers/aesthetics of using Ruby while also have checkboxes on the capabilities side of things.

Yes I tried Crystal, but unusable static linking is the showstopper here (need to share programs with other mac os users).

To all HN Ruby/Rust folks here: do some of you feel the same? Is there modern tooling around Ruby 3 to bundle apps statically, have some intellisense like rust-analyzer, code formatters like rustfmt/gofmt? Or reverse: is there a dead-easy GUI framework like shoes, or an easy way to create nicer DSLs/APIs or something that extends Rust to a ruby-like OOP/class system?

(I know this goes against many of Rusts philosophies, but sometimes things _are_ modelled most elegant with class hierarchies, especially when teaching less proficient developers... also why I loved Shoes so much, the feedback loop/hacky approach for new programmers was incredibly motivating.)

I don‘t know how to articulate it better (expressing feelings is hard for me), but basically I want Rusts capabilities but really crave Rubys elegance, especially the meta part (which is dreaded by others, I know). Or: I love _what_ Rust enables me to do, but miss _how_ Ruby did it. If you had the same dissonance before, how did you solve it?


  👤 joelbluminator Accepted Answer ✓
> Is there modern tooling around Ruby 3 to bundle apps statically, have some intellisense like rust-analyzer, code formatters like rustfmt/gofmt?

Well, no. But, it IS improving. Working on Ruby with something like Rubymine in 2021 is not the same as doing it in 2010, and it will keep getting better (Ruby 3 is also adding a kind of optional types btw). But of course it will never reach the level of a compiled language.


👤 ufmace
Man, I don't know. I like and have used both. It sounds like you kind of want a language with parts of both, but that doesn't seem like it would be possible. What is possible is calling Rust packages from Ruby, and I think you can run ruby stuff in Rust too. I've done it with Helix, and there's a few other options too.

👤 colesantiago
You're looking for Crystal, it's just hit 1.0. macOS doesn't have proper static linking anyway.