by vinceguidry · 5y ago · 0 comments
There are lots of different ways to extend Ruby with code in other languages such as C or Rust, there's DragonRuby if you wanna make games, you can run Ruby on the JVM, JRuby and nowadays TruffleRuby, there's even a slimmed-down Ruby suitable for use in embedded contexts, mruby, which is what I replaced all of my Crystal code with. (if you go this route, the best way I've found is to compile your own mruby with whatever you want in it, and put a #!/path/to/mruby shebang at the top of your scripts. Compile if you need even more perf, I found JITted mruby to be more than sufficient.)
Crystal isn't a bad language, but the only thing it shares with Ruby is a small subset of syntax. It's sorely lacking in maturity and in libraries and tools. It's unfortunate because Crystal is an idea worth exploring, but its proximity to Ruby means people will always position it against Ruby, and it will always fall short. And with types now in Ruby that's one less reason to pick Crystal over Ruby.
The story around types in Ruby is very early. There are "competing" ways to do it and they are really not dev ergonomic.
I think Ruby has a loooong way to go with typing to take it off the list of things to use Crystal for.
Example: Last time I checked couldn't find a firebase library for Rust, so gave up on it.
Rust seems a bit immature in the library department no? But didn't stop it becoming popular. I bet Crystal will do the same.
You mean at least a year younger ?
Rust
>The language grew out of a personal project begun in 2006 by Mozilla employee Graydon Hoare,[18] who stated that the project was possibly named after the rust family of fungi.[29] Mozilla began sponsoring the project in 2009[18] and announced it in 2010.
Crystal
>Work on the language began in June 2011