I'm a Ruby dev learning Rust. We, at my company, have a Ruby Sinatra agent for managing servers, it setup users, dbs, web pages, emails, config templates, lot of admin tasks.
It is written in Ruby and we will like to write it in Rust, the main reason is the memory consumption and the possibility to drop it as a single binary without any/many deps.
The Ruby agent is big and full of features, It is hard but we went really far in implementing the functionalities in Rust (using Rouille, r2d2), but its still hard, database interaction is tough (compared with Ruby).
We will continue anyway but I'm thinking in other options. I would like to split the http/rounting api (rust) from the scripts to reuse existing ruby code and migrate gradually different parts.
I know I can run commands (ruby scripts) from Rust and capture output (this will need ruby/rubygems installed) but what other posibilities do I have?
Could I embedd ruby in a rust binary, and package rust app + ruby code?
Can I have Rutie to load gems and execute code from there? If you could give me some example or projects to look into would be awesome.
At the end I think I have to migrate everything to Rust, but on the side I'm looking for different ways to aproach this migration.
Thanks in advance!