Crystal 1.2.2 Is Released(crystal-lang.org)
crystal-lang.org
Crystal 1.2.2 Is Released
https://crystal-lang.org/2021/11/10/1.2.2-released.html
6 comments
Been 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).
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).
> 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
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
I 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.
Crystal 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.
I don't use it for work because I work for a Rails shop and we're currently happy with Rails.
I'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)
- cryptic error messages, mostly type-related: this might have got better in subsequent releases, I guess.
- 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)
- cryptic error messages, mostly type-related: this might have got better in subsequent releases, I guess.
I 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
[1] https://github.com/rubocop/ruby-style-guide#no-then
I 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.
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.
I really like crystal (coming from ruby 10 years ago) and I still check it from time to time, but the number one showstopper for me using it more is that static linking is not possible like in Go or Rust.
Just compile a binary from my Mac and send it over to peers or compile it within a Github Action/scp it to a plain new linux server/run it - a comfort I am not willing to give up.
(No, docker stuff doesn't cut it)
Just compile a binary from my Mac and send it over to peers or compile it within a Github Action/scp it to a plain new linux server/run it - a comfort I am not willing to give up.
(No, docker stuff doesn't cut it)
> but the number one showstopper for me using it more is that static linking is not possible like in Go or Rust.
Which part [1] of it is not possible?
[1] https://crystal-lang.org/reference/guides/static_linking.htm...
Which part [1] of it is not possible?
[1] https://crystal-lang.org/reference/guides/static_linking.htm...
Not all shows need portability so why stop them all? Desktop applications absolutely, but It's trivial to build, deploy and operate docker containers on servers.
> We have been able to do all of this thanks to the continued support of 84codes, Nikola Motor Company and every other sponsor.
Wait, that Nikola is a sponsor? How? Why?
Wait, that Nikola is a sponsor? How? Why?
Because they want to sponsor Crystal?
As long as funding is going towards improving the language and ecosystem, I really don't see the issue here.
As long as funding is going towards improving the language and ecosystem, I really don't see the issue here.
Wasn't the company based on lies and fraudulent activities? I remember hearing about it a few months ago. It doesn't look good for a language to be associated with such a company.
Complete nonsense.
Should I stop using Rust because Facebook / Meta is using it for cryptocurrencies and they want to be a part of growing the Rust ecosystem?
Should I stop using Rust because Facebook / Meta is using it for cryptocurrencies and they want to be a part of growing the Rust ecosystem?
This is interesting considering Rust is the most loved language on HN and Facebook is the most hated company on HN.
For any other language or framework I would not be surprised ( I could almost bet ) the common view on HN would be to stop using it, example MySQL, Java etc.
But given this is Rust.
For any other language or framework I would not be surprised ( I could almost bet ) the common view on HN would be to stop using it, example MySQL, Java etc.
But given this is Rust.
It seems real strange that they're using Crystal, I don't see "HTML5 Supercomputer" listed as a supported platform.
Mind explaining the joke?
https://www.truckinginfo.com/330475/whats-behind-the-grille-...
See the "Advanced Electronics" section about halfway through the article.
See the "Advanced Electronics" section about halfway through the article.
> "The entire infotainment system is a HTML 5 super computer," Milton said. "That's the standard language for computer programmers around the world, so using it let's us build our own chips. And HTML 5 is very secure. Every component is linked on the data network, all speaking the same language. It's not a bunch of separate systems that somehow still manage to communicate."
You know SpaceX uses electron for it's UI's, right?
[deleted]
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?)