Live data from Hacker News

Switch from Ruby to Crystal

blog.logrocket.com

1–10 of 37 posts

Re: Switch from Ruby to Crystal

#2
I'm a Rubyist by profession and I've tried Crystal multiple times but never really felt like I was enjoying it. I can't really put my finger on why, but perhaps it falls into the "uncanny valley" where it looks a lot like Ruby but is slightly different in peculiar ways.

I vaguely recall being confused about including other files and module definitions last time, like you could put the requires in really weird places. It has been a while, though.

Oddly, I found Elixir much more enjoyable, and extremely quick to learn. Whereas Crystal feels like an attempt to build a "compiled Ruby", Elixir feels more like it took the ideas behind what Ruby is and applied it to a wildly different design, and as a result actually feels like how Ruby felt when I first learnt it.

But I do give Crystal a go every once in a while just to see if I finally get the hang of it.

Re: Switch from Ruby to Crystal

#8

One of Ruby’s pillars is metaprogramming. Crystal lacks that entirely, making it a non-option for many Rubyists.

Crystal has compile-time metaprogramming, which is it's own thing and has many sensible uses... but yes it's not the metaprogramming people are used to in Ruby and that the entire Ruby ecosystem is pretty fundamentally built on.

Re: Switch from Ruby to Crystal

#9
post #2

I'm a Rubyist by profession and I've tried Crystal multiple times but never really felt like I was enjoying it. I can't really put my finger on why, but perhaps it falls into the "uncanny valley" where it looks a lot like Ruby but is slightly different in peculiar ways. I vaguely recall being confused about including other files and module definitions last time, like you could put the requires in really weird places.…

The problem is:

> Crystal’s syntax is almost identical to Ruby’s...

...But the semantics are very different.

So you're writing in one language but it's as if the meaning has been swapped out underneath for the meaning from another language.

Re: Switch from Ruby to Crystal

#10
post #6
post #3

> So, what’s the catch? No windows support. (Seems to be progressing, though) https://github.com/crystal-lang/crystal/issues/5430

Compilation times can hurt too, I'm not sure if that's improved or being worked on though.

Crystal does global type inference to be performant while “feeling like a dynamic language” - as claimed by the article. This leads to very high compilation times (which is non-linear so a program double the size will likely take more than double the time to compile) and last time I asked I was told it is not a solvable problem.
Post reply on HN