I tried this very thing, and very quickly started looking for other options, landing on mruby. Compiled mruby is almost as fast as just writing bare C. I just compile an mruby interpreter and use that to run .rb files when I want speed. It's fast enough for me.
Much, much better than trying to shoehorn Crystal into this role.
Thanks for the tip, looks like mruby is even a better way to provide portable ruby scripts. I'll check it out.
> Compiled mruby is almost as fast as just writing bare C. That's interesting!
Just tried mruby and it seems to work very well, the packages seems enough for me aswell. https://mruby.org/libraries
But how did you manage to compile the .mrb to a binary? The boilerplate on the website does not seem to work for me. https://mruby.org/docs/articles/executing-ruby-code-with-mru...
That's a weird response.
I actually do it, there is no reason for me to lie. Keep in mind that I don't use any gems. That is why it works.
Crystal is not an drop-in replacement because some features Ruby has does not work in Crystal, but you can just write it in another way that Crystal supports.