DEV Community

Farhad Eyvazli
Farhad Eyvazli

Posted on

What is your approach to Crystal

What do you think about crystal? Nowadays I really hear about crystal programming language. I am a rubyist and syntax of crystal is similar, even identical sometimes. But does it worth to learn? What do you think about that?

Top comments (3)

Collapse
 
jgaskins profile image
Jamie Gaskins

I've been working with Ruby for about 15 years now (since before Rails) and I'm really excited about Crystal. I've been playing with it for a while now to try to understand tradeoffs in static vs dynamic types a bit more. Having such a similar syntax and core/standard library allows for more direct comparisons than, say, comparing static types in Java vs dynamic types in Ruby.

After seeing how much more performant certain things can be in Crystal with drastically reduced memory usage, it's been making me want to port all my Ruby services to it. ๐Ÿ˜‚

Another thing that I love in Crystal that I've been wishing for in Ruby for so long is spawn. Being able to spin off an async block that will clean itself up is just amazing.

Collapse
 
blankfella profile image
blank

I used Crystal in a small side project, in which I needed CPU intensive work to be done. I wrote my script as a Rake task in Ruby, then wrote my CPU intensive task in Crystal, compiled it, called it through Ruby's system call, using a library for parallelism called Parallel, since Crystal is still not able to do that (yet). all this while writing almost in the same language (syntax).

I would say it's a great combination, and would definitely migrate that side project completely to Crystal, once I can figure out a solution for parallelism (using all CPU cores at once).

Collapse
 
girng profile image
I'mAHopelessDev • Edited

i have already converted my old nodejs gameserver to crystal. now, i'm continuously adding more features which is a breeze. it's definitely worth it, and the community support is great too. if you ever run into an issue, there are so many channels to receive help. some are: gitter, official forum, dev.to, github, SO, etc. your question will basically never go unanswered or "unseen"! IMO, you got nothing to lose, give it a shot!

also, since you are a rubyist, you might find this helpful:

crystalforrubyists.com/

see you around!