Some disadvantages:
- Compilation is a bit slow
- Small community
- Few learning resources
- Windows version is still under development (not 1.0 ready)
I'm impressed by the language and find it very likable. It's not often discussed on HN, which is a shame.
If you are using Crystal, or have taken a look at the language, what are you thoughts on the language?
It’s more production ready than much I’ve encountered elsewhere with less need for external “shards” or libraries.
The executables are small and to give you one example: a nodejs app that used 500mb of ram is now consuming 25mb as a crystal executable that doesn’t require any minding and happily runs for months with no change in the overall memory consumption or evident leakage. This executable was built on the same machine it runs on and can use normal systemd units and controls etc.
The standard library is built for purpose and has most of what you need.
I agree that compile times are slower than ideal but not like c++ slow or anything, like 30 seconds for one app that’s roughly 30k LOC fwiw.
I use a combo of standard lib .ecr server rendered templates and named js bundles from the frontend build toolchain to speed up the dev cycle. Most backend functionality in crystal works as intended once it compiles.
I really wouldn’t consider anything but Rust an improvement (gets rid of our Boehm GC) as crystal is just nicer to work with than Go, and less hassle or nonsense than c or c++…
Obviously it blows the doors off anyway interpreted even with native extensions… it is FAST
It absolutely is. In fact, it's how I found out about the language. There's been several conversations about it and each release is posted on HN. For example: https://news.ycombinator.com/item?id=27903288
Crystal as a language is fantastic IMO. The type system literally forces you to consider race-conditions. Never had a language make me eat my vegetables in such a way. The code runs incredibly fast (on par with Rust and Go).
However, like the points you listed, it's hasn't "gone critical." It needs the basics to get even a hundredth of a percent of traction: cross-platform, IDE support, and some "killer" use-case.
* It has nice features, seems decently fast (I wasn't able to fully test just how fast)
* The language is complicated, there's so many built-in language constructs it doesn't fit in my head cleanly. I often found myself forgetting about entire features of the language by the time it was appropriate to use them
* The stdlib is decently documented, has good coverage
* Type system is top notch, tagged union types are the future of static typed languages IMO
* It's very not mature. I encountered many poor error messages, seeming compiler errors, poorly documented behavior, etc.. It has potential, but I wouldn't recommend it for production use today.
Worse, the use cases that crystal aims to solve for ruby, are not things that would attract people to ruby in the first place. Few people need a compiled language and reach for ruby, to find it lacking, and then look at crystal. The people with problems that crystal solves were never looking at ruby in the first place. They're not interested in tricks like `1.day`.
My impressions:
* it feels pretty fun and productive. Right now only Elixir feels better than that, so it's good to have fun on the system programming space.
* it's too slow to compile. This is a major pain point for me, iteration speed should be priority #1. I'd love a REPL.
* it's incredibly easy to hack on the compiler. I sent today my first PR to fix a bug in the stdlib.
* great stdlib, needs better documentation, again Elixir would a great inspiration for how to write docs. I'd love more monadic functions to deal with nils.
* github feels healthy and very active, but the whole ecosystem feels like it's stalled in the past 2 years. Pretty much nobody talks about it, most deps haven't been updated in years, it has a ghost town feel.
* it would fit nicely in my list of favourite languages. Zig for very low level, Crystal for native high level, Elixir for daemons and long running services.
Verdict: I like it a lot, it could be my favourite system programming language, but outreach and hype would give me some hope it's going somewhere and not dying a slow death.
Personally my biggest issue is the compile times. For web app development where you may be saving frequently and using hot reloading it’s to slow, it’s lagging.
If non-production compile times were reduced by 60-80% I could envision interest and adoption increasing quickly.
What was missing at the time was the equivalent of the gem ecosystem. I'm not sure if that has changed.
Here's the talk if you are interested: https://www.youtube.com/watch?v=B6Hx5wgNFL0
Unfortunately it has a small community. For instance in my opinion one would rather build a web application using ruby than crystal. The only ruby-like language that has gained some level of success and popularity is elixir.
That said it might as well be a toy language, in my opinion, because I don’t think it has the support or community to power a serious production project
Maybe ask Nikola Corporation? [0]
[0] https://manas.tech/blog/2020/02/11/nikola-motor-company/
It has a Ruby-like syntax but performance is better than Ruby. The creators of this language say that in many cases the speed will be close to C++. Also, programmers who know Ruby will not have much problem using Crystal.
The language is still in development but I think that it has a future. Another important thing is that the community around this language is growing very fast and there are many jobs for developers who know this language.
I think that Crystal could be another option for languages such as Java and C# because it has similar features like static typing, compiles to native code, etc. The tooling is a little bit rough around the edges, but I think that's to be expected for a language that's only been around for three years. The community seems really active and helpful, though, and I have no doubt that these tools will improve over time as the language develops.
I recommend Crystal to anyone who's had trouble with Ruby's speed or who wants more type information available. Definitely check it out!