Crystal might not be the most popular, but it is very interesting to me, I'm not a Ruby guy, but I was looking into other languages other than Go, Rust, etc that are natively compiled, I've dabbled with Nim, but I really wanted to try something slightly different, and I'm honestly impressed, it needs some slight polish still, maybe better funding might help, but in a different timeline under the right conditions, I genuinely think Crystal could have taken off as a really solid language. It's LLVM based, has green threads (that are insanely lightweight), has C-interop, has a comp-time macro system for AST inspection, code generation and removing boilerplate code.
The web frameworks look interesting too, but I haven't deep dived those just yet. You really get a Rubylike language with native performance which is very interesting.
One thing I wanted out of Nim is slightly more Python-likeness, I want regular OOP, since Crystal takes from Ruby (I believe it was originally written in Ruby, before it became self-hosting) it has sane OOP features I miss when I use Go, Rust or even Nim.
I really feel in a different timeline, Crystal could have been something, I also feel like "Ruby" for some leaves a bad taste, but Ruby is nowhere near as awful as most people think, even though it was never for me, it was still one of the nicest ecosystems I ever worked with long before Go got its package management situation situated.
Edit one more thought: I believe the Windows installer / Windows support for Crystal is a newer addition if I'm not mistaken, so it took a while before it got proper Windows support. Well, I just googled it, it started in 2023... but still, that's fairly recent by my book. I think any programming language should strive to work across the "big three" as soon as possible to increase adoption. Go took off the moment it came out for Windows and was formally released.
Agreed. I saw the announcement and had an inkling of the excitement I got the first time I tried Crystal, years ago. I remembered how exciting new languages were to learn, and putz around with.
Then I remembered I could open [coding agent of choice] and it'd nearly oneshot whatever I would want to try in Crystal. I got a little disheartened.
Some languages for me were never meant to be 'used in production', but were a creative & learning space instead.
I may be one of the few to use Crystal in anger for long running programs but unfortunately we had to do away with it because of longstanding issues in the runtime where exceptions at the wrong time during I/O bring the runtime to a halt. It's been a few years so I don't have the github issue off the top of my head anymore. I'd like to think that if they could redesign the language again they would not have exceptions and destructors/finalize.
It's a great language for CLIs though. I'm glad to see the team still pressing on.
Mainly because normal Ruby is an awesome language to write code, and it is also a language that's tried and lost the spotlight because its performance is really, really low, even when compared only with other interpreted languages.
What a ridiculously negative comment. Obviously ragebait, but I'll bite anyways.
Did you forget that until five minutes ago humans used to read the code? And they needed to understand it? Yes, there was an actual desire for great Ruby-like syntax without the implications of using it, like its performance characteristics and the need for an interpreter.
Yes, it didn't go mainstream. Should we all abandon every project we've ever worked on because they're not "relevant"?
Prior to LLMs, Crystal was my language of choice when I needed a distributable binary. It works great for this, and for the kind of packages I was writing - mostly agent-daemons lurking in servers - the networking worked great. The only real alternative was golang, which I've never really liked and has (had?) a more complicated linking story too. The typing worked well too, if used with discipline - if it compiled, I could be pretty confident it would work. I still have systems deployed running Crystal agents, in production, without issue or memory leaks, for years.
LLMs though - I confess they've changed the calculus. Now I no longer have to look at the language, and obey its stupid ideas about error handling, I just use golang for its better library support. But I still have a soft spot for Crystal!
what does this language excel at in particular? havent heard of it before and didnt find a clear use case / mission statement on the webpage. unless I'm missing where to find it. just curious to learn more.
Crystal is for when you want to write C with Ruby-ish syntax. It's been around for awhile, all the way back to when Ruby was required to get VC funding.
In my opinion, it doesn’t excel at anything beyond being pleasant to read. Maybe if Go hadn’t come along, it would have gained more traction and developed a better concurrency runtime. Very few companies are publicly using it.
Plus, since 00s Ruby = Ruby on Rails, so it didn't appeal to ruby (on rails) developers back then.
They have an interactive mode right now (crystal i), but it's not very comprehensive. You cannot use certain libraries with it etc.
Shouldn't be terribly hard to make it good though. Some time ago, I added a JIT REPL in a few afternoons with Claude, ending up with roughly the same performance as their compiler, and with it working reliably with all the libraries I tested. But since they don't want LLM contributions in Crystal, I just left it as an interesting experiment and started working on my own language instead.
great that aarch64-linux support is now promoted to Tier 1! finally, I can convince my CTO to port some of our services in crystal for those cheap hetzner machines.
Crystal might not be the most popular, but it is very interesting to me, I'm not a Ruby guy, but I was looking into other languages other than Go, Rust, etc that are natively compiled, I've dabbled with Nim, but I really wanted to try something slightly different, and I'm honestly impressed, it needs some slight polish still, maybe better funding might help, but in a different timeline under the right conditions, I genuinely think Crystal could have taken off as a really solid language. It's LLVM based, has green threads (that are insanely lightweight), has C-interop, has a comp-time macro system for AST inspection, code generation and removing boilerplate code.
The web frameworks look interesting too, but I haven't deep dived those just yet. You really get a Rubylike language with native performance which is very interesting.
One thing I wanted out of Nim is slightly more Python-likeness, I want regular OOP, since Crystal takes from Ruby (I believe it was originally written in Ruby, before it became self-hosting) it has sane OOP features I miss when I use Go, Rust or even Nim.
I really feel in a different timeline, Crystal could have been something, I also feel like "Ruby" for some leaves a bad taste, but Ruby is nowhere near as awful as most people think, even though it was never for me, it was still one of the nicest ecosystems I ever worked with long before Go got its package management situation situated.
Edit one more thought: I believe the Windows installer / Windows support for Crystal is a newer addition if I'm not mistaken, so it took a while before it got proper Windows support. Well, I just googled it, it started in 2023... but still, that's fairly recent by my book. I think any programming language should strive to work across the "big three" as soon as possible to increase adoption. Go took off the moment it came out for Windows and was formally released.
> I want regular OOP
Why would you want that? Just to continue the habit? I'd say regular OOP is, after implicit `null`, the biggest mistake in software.
Crystal is nice, but for network programming, Go simply cannot be beaten by a language that has a equally limited type system.
It’s sad that we don’t write code anymore, it takes a lot of the joy of stuff like this away.
Agreed. I saw the announcement and had an inkling of the excitement I got the first time I tried Crystal, years ago. I remembered how exciting new languages were to learn, and putz around with.
Then I remembered I could open [coding agent of choice] and it'd nearly oneshot whatever I would want to try in Crystal. I got a little disheartened.
Some languages for me were never meant to be 'used in production', but were a creative & learning space instead.
You can still write code. I do it every day, even for work.
I may be one of the few to use Crystal in anger for long running programs but unfortunately we had to do away with it because of longstanding issues in the runtime where exceptions at the wrong time during I/O bring the runtime to a halt. It's been a few years so I don't have the github issue off the top of my head anymore. I'd like to think that if they could redesign the language again they would not have exceptions and destructors/finalize.
It's a great language for CLIs though. I'm glad to see the team still pressing on.
For those that don't know: Crystal is like a typed Ruby with the performance and concurrency flow of Go.
> Crystal is like a typed Ruby with the performance and concurrency flow of Go.
I'm not up to date, but the scheduling engine was far behind Go in terms of parallelism. Crystal was always quite good at concurrency.
But Go is popular because it's so good at parallelism (and relatively safe with a garbage collector).
I know Crystal has been working on this for the last few releases, but I'd be surprised if it's matching Go on parallelism.
Go's runtime is quite the engineering feat.
It can often outperform hand-optimized Rust in worst-case parallel workloads (p99), despite Rust having a number of pretty huge advantages...
That actually sounds awesome.
Mainly because normal Ruby is an awesome language to write code, and it is also a language that's tried and lost the spotlight because its performance is really, really low, even when compared only with other interpreted languages.
...and a community the size of Elm.
Is Crystal even relevant at all now?
It isn't interoperable with Ruby and I don't know of any reputable companies using Crystal.
It just looks like Ruby, but it isn't Ruby and it is a compiled language? OK?
I am not sure why I should learn this language?
> I don't know of any reputable companies using Crystal.
Kagi uses Crystal for their search backend [1]. How they feel about that today and whether that was the right call are, of course, separate questions.
[1] Previous thread: https://news.ycombinator.com/item?id=38421149
What a ridiculously negative comment. Obviously ragebait, but I'll bite anyways.
Did you forget that until five minutes ago humans used to read the code? And they needed to understand it? Yes, there was an actual desire for great Ruby-like syntax without the implications of using it, like its performance characteristics and the need for an interpreter.
Yes, it didn't go mainstream. Should we all abandon every project we've ever worked on because they're not "relevant"?
Because it is a nice language to write elegant and performant code in. If that is not enough motivation I guess it is not a language for you.
Prior to LLMs, Crystal was my language of choice when I needed a distributable binary. It works great for this, and for the kind of packages I was writing - mostly agent-daemons lurking in servers - the networking worked great. The only real alternative was golang, which I've never really liked and has (had?) a more complicated linking story too. The typing worked well too, if used with discipline - if it compiled, I could be pretty confident it would work. I still have systems deployed running Crystal agents, in production, without issue or memory leaks, for years.
LLMs though - I confess they've changed the calculus. Now I no longer have to look at the language, and obey its stupid ideas about error handling, I just use golang for its better library support. But I still have a soft spot for Crystal!
There are Minecraft bots written in Crystal, which was the first time I'd heard of it.
what does this language excel at in particular? havent heard of it before and didnt find a clear use case / mission statement on the webpage. unless I'm missing where to find it. just curious to learn more.
Crystal is for when you want to write C with Ruby-ish syntax. It's been around for awhile, all the way back to when Ruby was required to get VC funding.
In my opinion, it doesn’t excel at anything beyond being pleasant to read. Maybe if Go hadn’t come along, it would have gained more traction and developed a better concurrency runtime. Very few companies are publicly using it.
Plus, since 00s Ruby = Ruby on Rails, so it didn't appeal to ruby (on rails) developers back then.
Fast, compiled Ruby. If you like that, there you go.
I looked closely at Crystal when it first got popular but they removed the REPL which for me made Elixir a better choice.
They have an interactive mode right now (crystal i), but it's not very comprehensive. You cannot use certain libraries with it etc.
Shouldn't be terribly hard to make it good though. Some time ago, I added a JIT REPL in a few afternoons with Claude, ending up with roughly the same performance as their compiler, and with it working reliably with all the libraries I tested. But since they don't want LLM contributions in Crystal, I just left it as an interesting experiment and started working on my own language instead.
Glad to see the continued progress on adding support for Windows.
great that aarch64-linux support is now promoted to Tier 1! finally, I can convince my CTO to port some of our services in crystal for those cheap hetzner machines.
Fast Ruby with no moat. Next.