Ruby is a super nice scripting language. I much prefer it to python when I need something with a little more "ooomph" than bash. It's just...nice...to write in. Ruby performance has come a long way in the last decade as well. There's libraries for pretty much everything.
My modern programming toolkit is basically golang + ruby + bash and I am never left wanting.
I do find Crystal (https://crystal-lang.org/) really interesting and am hoping it has its own "ruby on rails" moment that helps the language reach a tipping point in popularity. All the beauty of ruby with all of the speed of Go (and then some, it often compares favorably to languages like rust in benchmarks).
> I actually compile my Ruby scripts with Crystal when I want a portable binary!
Na, you probably don't do it, but you think you could do it. Until you really have to do it and then you see that Crystal isn't a drop-in replacement for ruby. Anyway.. if every single "Dude use Crystal" person commenting on HN would be actually using Crystal, what huge community we would have ;)
> Na, you probably don't do it, but you think you could do it.
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.
If you're being serious, then you're sticking very intentionally to the very small subset of Ruby that compiles to Crystal and missing out, unnecessarily, on the very amazing features that both languages offer to no great advantage.
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.
You're right, Crystal might not be the best choice but it does the job so far.
Shipping compiled binaries is so sweet, having to force every user to install the Ruby runtime isn't fun.
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
You're using the wrong option, the one you want is at the bottom, where you use the -B option to dump the bytecode into a C array, which you then wrap with a bit of boilerplate so as to compile into a standard executable. Once you understand it it should be easy enough to script.
My modern programming toolkit is basically golang + ruby + bash and I am never left wanting.
I do find Crystal (https://crystal-lang.org/) really interesting and am hoping it has its own "ruby on rails" moment that helps the language reach a tipping point in popularity. All the beauty of ruby with all of the speed of Go (and then some, it often compares favorably to languages like rust in benchmarks).