News for hackers. Stuff that matters.
Re:An Introduction to Crystal by klelatti on Sunday February 21, 2021 @04:28PM (#26217400)
Having written a Ruby (not Rails) app that would benefit from Crystal's speed and typechecking (and made a start on a conversion) I worry that the language won't find a niche that ensures its long term survival. Is there any area where Crystal is likely to provide a compelling solution when compared to other languages?
Re:An Introduction to Crystal by jiofih on Sunday February 21, 2021 @06:57PM (#26218639)
It’s niche is being a high level typed language with extremely nice syntax, while having speed that competes with Rust/Go and others. The best thing that can happen is for it to get its own life away from Ruby.
Re:An Introduction to Crystal by klelatti on Sunday February 21, 2021 @08:03PM (#26219289)
Just to clarify I meant niche as in use / market. I agree on the characteristics - where does it 'win' though vs Go / Rust which are already well established. I don't see any movement from those communities to even try Crystal.
Re:An Introduction to Crystal by chillfox on Sunday February 21, 2021 @08:37PM (#26219644)
Well, it wins for those of us who dislike Go/Rust syntax. Crystal is much easier to read/write than Go/Rust (Yes, I know that the majority of programmers like it the other way).
Re:An Introduction to Crystal by klelatti on Monday February 22, 2021 @08:18AM (#26224138)
I hope you're right as I much prefer ruby syntax too!

I just think that maybe rubyists overstate the attractions of the 'programmer friendly' nature of ruby a bit as outside of rails it's lost out vs Python for example. And Rails is popular because of the web app DSL that it provides (and so relies on Ruby Metaprogramming which crystal doesn't have).

Re:An Introduction to Crystal by chillfox on Monday February 22, 2021 @09:15AM (#26224754)
I use Ruby for work all the time and Crystal for hobby projects and I still haven’t used Rails or Ruby’s meta programming, but I have used Crystals macros.
Re:An Introduction to Crystal by m12k on Sunday February 21, 2021 @05:12PM (#26217785)
The absolute killer would be having a (ideally automatic) way to port existing Ruby applications to Crystal, and thus also tap into the existing ecosystem around Ruby. Though in order for that to really take off, they'd need to be able to port Rails too, which is probably quite tricky (considering how much metaprogramming Rails does for its "magic").
Re:An Introduction to Crystal by burlesona on Sunday February 21, 2021 @05:57PM (#26218213)
I think for this to have a realistic chance, you have to have some effort on the rails side to reduce the meta-programming. I doubt that’s going to happen.

It is certainly possible to port Ruby applications to Crystal without a total rewrite, but the addition of static types in and of itself means you may be surprised at how much fiddling is required to get the compiler to approve your code.

Re:An Introduction to Crystal by klelatti on Sunday February 21, 2021 @06:04PM (#26218266)
Having done some of this agree 100% with the "surprised at how much fiddling is required".

I think in practice that Crystal will have to carve out its own niche distinct from Ruby - and I'm not sure whether the Ruby like syntax is much of an advantage against competing languages.

Re:An Introduction to Crystal by chillfox on Sunday February 21, 2021 @08:41PM (#26219679)
It doesn't have to beat other languages, it just has to enable new domains for people who only like ruby like languages to be successful.
Re:An Introduction to Crystal by klelatti on Sunday February 21, 2021 @05:33PM (#26217989)
Absolutely and given the resources that firms spend on servers running Rails (GitHub, Shopify etc) I could see the effort being put into it - if it's possible. I suspect the metaprogramming issue is really tricky though.