3 ms·
Crystal is a very nice language. It is strongly-typed and inspired by Ruby's syntax but not identical to Ruby. Crystal's performance is excellent, but compiling
by open-source-ux 5y ago
Crystal is a very nice language. It is strongly-typed and inspired by Ruby's syntax but not identical to Ruby. Crystal's performance is excellent, but compiling is a little slow. (And no Windows support yet - but under development.)
Given these features, there does not appear to be much adoption of Crystal among Ruby developers. It is still early days for the language (post 1.0 release).
Some questions for Ruby developers:
- Have you taken a look at Crystal?
- What is your impression of Crystal?
- Are there any features that would make you use the language? (Or reasons for not using Crystal?)
- zem 5y agoI was interested in it as a possible language to write cross platform desktop apps in, since distributing end user apps with ruby is a pain, but the lack of windows support made that a non starter.
- Toutouxc 5y agoCrystal is currently my go-to language when I want to try something out, like a new algorithm, data structure or problem, and I want to write it in Ruby and have the Ruby kind of fun doing it, but I also want it to be fast and consistent (like in Ruby you can do N-sized input and in Crystal you can do N*10). I don't use it for work because I work for a Rails shop and we're currently happy with Rails.
- Doctor_Fegg 5y agoI've taken a look and it's interesting. The two downers for me were: - needless differences to Ruby: for example, the devs have refused to implement single-line if...then...end simply because they don't like it (https://github.com/crystal-lang/crystal/issues/4117 https://github.com/crystal-lang/crystal/issues/4117) - cryptic error messages, mostly type-related: this might have got better in subsequent releases, I guess.
- ksec 5y agoI dont understand the hatred for "then" even in Ruby [1]. I have seen a lot of students prefer to put the word "then" to make things easier for them. [1] https://github.com/rubocop/ruby-style-guide#no-then https://github.com/rubocop/ruby-style-guide#no-then
- KarlKemp 5y agoI have 15 years+ of ruby experience. Recently had to do some data munging for science, mostly string manipulation. So many strings, the python script someone had made said it would take 8 hours. This was my first attempt with Crystal. It took me about 40 min to get it working, about twice as long as it would have taken in ruby. It then ran for 20 minutes and was done.
- helen___keller 5y agoBeen writing Ruby the past 3 years. I loved Crystal, because the syntax and idioms were familiar but the type system reminded me of SML, which I miss greatly. I wrote a tiny compiler in it, but didn’t use it again because I had no reason to. Unfortunately, I’m not sure what could be added to Crystal to make it stand out. The programming language space is somewhat bloated, and IMO to find a niche that doesn’t intersect with Ruby, Crystal needs to be able to compete with Rust and C/C++(Rust as the current novelty systems language of choice, C/C++ as the incumbent). I’m not sure if Crystal has a chance competing with Ruby/Python on their turf (hacking together scripts and web apps).
- Mikeb85 5y ago> Have you taken a look at Crystal? A bunch of times. > What is your impression of Crystal? Still not as nice as Ruby, but pretty slick and OK. Seems less mature and less useful than something like Nim, despite the similarities with Ruby. > Are there any features that would make you use the language? (Or reasons for not using Crystal?) Back in the day, the lack of any decent support for parallelism. It seems they do have a strategy for it now which seems ok. But on a whole, Ruby is fast enough for my needs and Crystal still isn't as easy to use. Edit - so just translated one of the benchmarks I use to test programming languages (economics benchmark, basically creates a bunch of arrays, performs a bunch of operations on them, compares them, etc..., that sort of thing - so lots of maths and looping) and Crystal is now slightly quicker than Nim although it produces an erroneous result so I'm curious about it's float64 implementation. Or maybe I got some syntax wrong going from Ruby -> Crystal. Also, if anyone's curious, times on the benchmark I used (and everything is written in naive code, except Python which uses Numpy data structures so presumably some optimisation there?) C++: 1.05 seconds Crystal: 1.3 seconds (but wrong result, for now) Nim: 1.4 seconds Ruby --yjit: 35 seconds Ruby --jit (mjit): 40 seconds Python3 (using numpy): 100 seconds Ruby no jit: 120 seconds