Hacker News new | ask | show | jobs
by viraptor 2041 days ago
It goes past syntax. Yes, they're different languages, but syntax, behaviour, stdlib are so close you can port non-trivial libraries between them in a relatively short time.
1 comments

The key word there is non trivial. Something with as many moving parts as Rails is non trivial, and Crystal doesn't have the run-time metaprogramming that Rails makes extensive use of. A trivial example is ActiveRecord generating attribute methods from your `select` operation.
I don't think rails is a fair example. Rails loves its runtime metaprogramming and that is not where crystal offers much, but I don't think it invalidates the overall similarity. There's trivial (scripts with simple flow), non-trivial (libraries with heavy oop design and a little bit of trickery), and there's almost everything else before we get to rails itself.

Just like in C, you have trivial, nontrivial, complex apps, then there's still a long way before production OS kernels at the extreme.

Many advanced libraries don't use metaprogramming much, and even if they do, it can be often made either more explicit or shifted to compile time.

Edit: The downvotes are interesting since the portability claim comes from my experience doing just that.

Shopify uses Rails. To your original question, which you've answered yourself: that's why they haven't joined forces. They were very clear in the article about the size and activity of their codebase, and their commitment to Rails in particular.
That wasn't my question :-) I was only addressing the syntax similarity bit since it's repeated write a lot.