Crystal 1.22
Posted by ksec 5 days ago
Comments
Comment by giancarlostoro 5 days ago
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.
Comment by flossly 5 days ago
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.
Comment by goatlover 5 days ago
I don't think anyone who regularly uses Ruby or Python thinks OOP is a mistake, it's in how you use it and whether one likes the OOP design of the language.
Comment by sroerick 5 days ago
I think the Lisps kind of have up on being an interpreter and I feel they lost some of their power because of it.
I kind of see Ruby waning right now, I don't think it offers much with the development of LLMs. I don't think adding typing is the key - but I anticipate there will be a kind of LLM-powered Smalltalk resurgence
Comment by pjmlp 5 days ago
With Objective-C/Swift, Java/Kotlin, .NET/C++/COM userspaces.
Comment by sroerick 5 days ago
But you know what I mean, right? What would be a better way to describe it?
Comment by pjmlp 4 days ago
Comment by cosmos64 4 days ago
Comment by zerr 5 days ago
Comment by giancarlostoro 5 days ago
I would have loved Go more if they had made "lightweight" classes a thing, something feels wrong tying structs and functions, you could have added a wrapper around both to make the code more organized. I guess that's what I like about OOP, organized code. I don't even care about most OOP things, I just want to organize code in a meaningful way.
Comment by flossly 5 days ago
Most of what I write are functions and data objects (records, basically).
One pattern I use is classes with one function, where the constructor takes the functions dependencies, and the function only takes non-dependency parameters.
Comment by pjmlp 4 days ago
Which is why, something like
fun square(num: Int): Int = num * num
gets translated into public final class ExampleKt {
public static final int square(int);
0: iload_0
1: iload_0
2: imul
3: ireturn
}
}
When running javap on the .class file.People really should understand what they talk about avoiding OOP.
Comment by pjmlp 5 days ago
Comment by flossly 5 days ago
Comment by pjmlp 4 days ago
Python 3.15.0 (tags/v3.15.0:d220409, Oct 9 2026, 11:55:56) [MSC v.1951 64 bit (AMD64)] on win32
Enter "help" below or click "Help" above for more information.
>>> def sum(x,y):
return x + y
>>> sum(40, 2)
42
>>> type(sum)
<class 'function'>
>>> dir(sum)
['__annotate__', '__annotations__', '__builtins__', '__call__', '__class__', '__closure__', '__code__', '__defaults__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__get__', '__getattribute__', '__getstate__', '__globals__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__kwdefaults__', '__le__', '__lt__', '__module__', '__name__', '__ne__', '__new__', '__qualname__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__type_params__']Comment by EdwardDiego 4 days ago
You certainly don't have to write OO Python if you don't want to. Objecting to functions being objects like the person you're replying to is, is a flavour of puritanism I find baffling.
Comment by wolvesechoes 4 days ago
I love this website. It proves that software "industry" is a pop culture after all.
Comment by cosmos64 4 days ago
Comment by burlesona 5 days ago
Comment by Malazath 5 days ago
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.
Comment by ModernMech 5 days ago
So it was a gamble learning something new could just result in a brick wall dead end where you can't fix the thing, you can't get in touch with anyone who knows how (or has time), there's no docs to help you on the way, the code base is a mess and inscrutable, maybe written the a language you don't know -- maybe even the one you're trying to learn! It could be very frustrating at times, to the point I'd just pass over some interesting languages if they weren't polished enough. Which is a shame because I know there's good ideas in there, I just can't invest the time to make sense of them. Seems contradictory, but designers are not always the best communicators.
With LLMs, all this consternation is gone. Can it write the program for you? I guess... but also not really because for many niche languages with interesting features, the LLM won't do so idiomatically, opting instead to implement enough functionality to scaffold a Python-shaped solution, and then it writes that.
The neat ideas are still there, the learning opportunity is still there, the ability to leverage technology in a way the LLM can't is still there. Especially in a creative and learning space!
Comment by EdwardDiego 4 days ago
Comment by miah_ 5 days ago
Comment by satvikpendem 5 days ago
Comment by neutronicus 5 days ago
Comment by pjmlp 5 days ago
Comment by ethin 5 days ago
Comment by afavour 5 days ago
Comment by itishappy 5 days ago
Comment by vips7L 5 days ago
Comment by outworlder 5 days ago
Comment by vips7L 5 days ago
Comment by goatlover 5 days ago
Comment by eatsyourtacos 5 days ago
Everyone who disagrees is just in pure denial or has never properly used an LLM to interact with regarding a code base.
Comment by lifeisloving 5 days ago
A lot of agentic use creates a feeling of psuedo productivity.
Ive only met two devs who genuinely have supercharged their output with them, but they were also superstars before CC.
The agentic only folks are twiddling their thumbs all day messing with their 20 different meta-agentic tools, thinking that extra thing is finally going to give them those superpowers too.
I think being a "super contributor" has little to do with just having access to llms, but people will downvote this.
Comment by satvikpendem 5 days ago
Comment by seanw444 5 days ago
Comment by lifeisloving 5 days ago
Comment by itishappy 5 days ago
Comment by slopinthebag 5 days ago
Comment by nozzlegear 5 days ago
Comment by pjmlp 4 days ago
Comment by rubiquity 5 days ago
It's a great language for CLIs though. I'm glad to see the team still pressing on.
Comment by sumnole 5 days ago
Comment by Shorel 5 days ago
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.
Comment by kenhwang 5 days ago
But then Python got a second wind in performance with better rewrite in Rust integration, but it looks like with the latest DHH keynote, Ruby might also go down that path.
My opinion is that I/O and concurrency ease of use and performance continues to be Ruby's weak point vs other interpreted languages. Which also happens to be Go's very few strong points.
Comment by onlyrealcuzzo 5 days ago
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...
Comment by straight-shoota 5 days ago
In the previous release (1.21) we enabled Execution Contexts as a parallelism engine. https://crystal-lang.org/2026/07/12/releasing-execution-cont...
It's even more flexible than Go because you can tune different contexts for specific workloads. Go still has more advanced optimizations and overall better thread-safety in libraries. But we're working on that...
Comment by onlyrealcuzzo 4 days ago
My main critique - which I'm sure you're aware of - is that the hardest part of doing this is predicting what your workload is actually going to be like. That's what Go does so well. It can get almost anything right without you needing to hand-tune it.
While I have you - are y'all planning to implement FSMs and thunks (for recursion) at any time in the near future?
This is something Go is unlikely to ever do unless it becomes a Go2 language.
I don't know enough about your runtime to know if it's remotely feasible given the choices you've made.
Comment by pjmlp 5 days ago
If only it had a few more features from 1970's languages, designed outside Bell Labs, or even those from Limbo that it still doesn't support.
Comment by giancarlostoro 5 days ago
Comment by ButlerianJihad 5 days ago
Happy International Caps Lock Day!!1
Comment by out_of_protocol 4 days ago
On other note, who the hell decided kibi, mebi, gibi are good prefix names? that's the reason no one uses them (me too)
Comment by ButlerianJihad 4 days ago
https://en.wikipedia.org/wiki/Kilobyte
The metric prefix "kilo" is always lowercase. I don't know how you got a capitalized "K", but that's not how it works.
Comment by giancarlostoro 5 days ago
Comment by goatlover 5 days ago
Comment by DetroitThrow 5 days ago
I will say this comes with the asterisk that it heavily depends on what your concurrent system/problems looks like!
...but more often than not when dealing with web problems and network IO, the shape of concurrency/parallelism I need looks exactly like Goroutines, and even as someone who uses Rust/tokio daily: the Go runtime is an incredibly engineered system that usually beats Rust in my experience for application dev tasks.
Anyways, I love Crystal's syntax around concurrency! I wish we lived in a world where it had tons of Google engineers optimizing the runtime :)
Comment by lowkeyliesmyth 4 days ago
Comment by flossly 5 days ago
Comment by sevenzero 5 days ago
Comment by bdcravens 5 days ago
Comment by nilamo 5 days ago
Which means you can have fun trying new languages with every new project :)
Comment by sevenzero 5 days ago
Comment by Thaxll 5 days ago
If you ask Claude create me a Crystal controller for Kubernetes, good luck with that.
Comment by jcmontx 5 days ago
Comment by lirolero 5 days ago
Comment by viraptor 5 days ago
And it's nice to see each version is getting better. The reference could get some love, but it's still ok.
Comment by opem 5 days ago
Comment by ch4s3 5 days ago
Comment by abc42 5 days ago
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.
Comment by ch4s3 5 days ago
Comment by abc42 5 days ago
Comment by ch4s3 5 days ago
I'm doing this because it interests me and I'm learning, but it does feel quixotic at times.
Comment by abc42 3 days ago
Seems like you're slightly more ambitious with the features (linear typing, refinement typing are way beyond what I dream about). I'm focusing more on a small practical application language with ruby-like aesthetics.
I wanted Hanki to be a general-purpose language that could be used with minimal compromises as a scripting language, a configuration language and a reasonably high-performing application / server-side language. I wanted a good REPL, arbitrary precision arithmetics by default, reasonable safety features (effects, strong typing, concurrency via message-passing actors, erlang-like supervising) and excellent readability for human reviewing.
I wanted to include features that force AI agents into a style, so the linter is included as part of the checker and every linter complaint is an error.
The implementation is currently 300K+ lines of Rust, about 60Kloc of Hanki.
I still have about a hundred beads tickets to go through before I'm happy enough about this that I dare to publish it. And seems like every solved task gets 2 follow-ups :)
Comment by ch4s3 1 day ago
This is super interesting, I really like it. Actor concurrency with effects is not as broadly implemented as it should be.
[1] https://march-lang.org/docs/capability-audit/#auditing-a-com...
[2] https://march-lang.org/docs/capabilities/#io-permission-caps
Is your source code online? I can't find it.
Comment by pelcg 5 days ago
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?
Comment by abound 5 days ago
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
Comment by dimgl 5 days ago
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"?
Comment by yxhuvud 5 days ago
Comment by vidarh 5 days ago
Comment by snek_case 5 days ago
My message to the HN community: HN is literally bankrolled by YC. If Crystal doesn't deserve to exist because other languages exist, why exactly should I care about your bullshit uber-for-dogs startup, or whatever not particularly original AI crap you think you're changing the world with these days? Get real. If you want people to be open to your ideas, maybe you ought to make an effort to be open to the ideas of others, and cultivate a climate where discussing different ideas is possible. Don't treat every HN post as an opportunity to opine on how you think the work of other people is flawed.
Comment by ricardobeat 5 days ago
You should learn this language if you want the nice developer experience, great stdlib, managed memory, native performance. Similar reasons to why you'd learn Go.
Comment by sho 5 days ago
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!
Comment by viraptor 5 days ago
It's close enough that porting things is often trivial (sometimes just slap a few signatures), as long as the code doesn't go crazy with metaprogramming. Yes, it's not the same and stdlib is a bit different. But it's a lot further than "looks like" Ruby.
Comment by axus 5 days ago
Comment by Primer81 5 days ago
Comment by 0x457 5 days ago
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.
Comment by 0cf8612b2e1e 5 days ago
Comment by vidarh 5 days ago
Comment by npn 5 days ago
Like every one else I also used ruby for almost everything back then, usually some hundred of lines or less for processing stuff. but for tasks that run for several hours using ruby was a frustrating experience. slowness and memory consumption aside, the duck typing system and lazy evaluation of method meaning you can run to typo after hours of running session. sure, you can fix it by write the code more carefully, running smoke tests beforehand and other stuff, but it still a chore, and when you write code all days it makes you sloppier.
having a strong typed compiled language helps it immensely, and with crystal you don't have to sacrifice the easiness of programming. and you can compile it to a portable binary and run it everywhere, no need to reinstall a huge toolchain again. (yeah rust or go can also do that, but not for ruby level expressioness language)
I'm sure crystal is not the ideal language for everything you want to use, and ruby is still helpful for what you use daily. but for some tasks, crystal surely has it own advantages. you can write very capable CLI programs without have to install a single library!
Comment by vidarh 5 days ago
But my main point was that people who do want a fast Ruby should be aware that Crystal isn't a Ruby in any meaningful sense - if you like Crystal for Crystal, by all means use it.
Comment by npn 5 days ago
also, using crystal you have parallel and concurrency to speed up your task. sure it is not as good as other matured languages, but it still does the job.
when doing with large amount of data, and with IO involved, you will see that your JIT or AOT engine for ruby still can not cut it, because in ruby there is so many layers of safety check and failure guard it is really hard to make it faster (number calculation is not everything). with crystal you can manipulate the io stream directly, avoiding a lot of intermediate steps. you can check yourself, they make a full page for it: https://crystal-lang.org/reference/1.22/guides/performance.h...
personally I do not use a single language, I just pick the most suitable language for the job I'm doing, let it be ruby, python, crystal, rust, go or typescript. but surprisingly crystal is the one I use the most everyday.
Comment by Jach 5 days ago
How about the crashes for all the other more common reasons? It seems like a concern unrelated to whether a language is strictly AOT-compiled or not, and whether such compilation runs through a static type checker or not, and in any case surely differs a lot among programmers' experience. (Crashes from typos basically rarely if ever happened to me in Python, same with memory constraint crashes. But I've never tried running Python on anything with less than 1 GB/core, if you don't count possibly some educational usage on ancient 90s hardware or a 2004 laptop; the lowest power device was probably a Cubietruck3 from 2013 that still had a generous dual-core ARM cortex-a7 and 2 gigs.)
But I agree with the sentiment, I hate it when programs crash and take out their work in progress or other state. I wish more languages adopted the Common Lisp condition system model, where errors don't crash or unwind anything by default and you can dynamically fix things and retry, or resume, or restart from a specific stack frame. There's even a book about implementing it: https://www.amazon.com/dp/B0DF5YVJKJ (And despite being dynamically typed, Common Lisp is compiled to native machine code, and some implementations like SBCL offer some bare-bones static checks to flag trivial typo or type mismatch issues during compilation, before running the code in question... You can also bolt on a full static type system language on top as a library if you want.)
Comment by vidarh 4 days ago
If your code is poorly enough tested for a typo to cause it to crash, a typo is the least of your concerns.
> also, using crystal you have parallel and concurrency to speed up your task. sure it is not as good as other matured languages, but it still does the job.
So you do in several Ruby implementations.
> when doing with large amount of data, and with IO involved, you will see that your JIT or AOT engine for ruby still can not cut it
I've used Ruby for large scale IO with Ruby for 20 years without problems, even on CPU's far slower, and with Ruby versions far slower than today. If you're doing IO with Ruby and the performance of your language implementation is what is limiting you, rather than spending most of the time in kernel space waiting for system calls to complete, you're doing something wrong.
Comment by Jach 5 days ago
Comment by Lio 5 days ago
Could also use Matz's Spinel Ruby compiler. That's Ruby with static types using RBS but you have to give up some metaprogramming to get it.
I love the idea that we could get ractors written with Spinel and compiled ahead of time. I also love the idea that I can use Ruby for self contained binary tools.
(And for the sake of avoiding confusion, Crystal is also a great project. I'm really pleased to see them continue making progress).
Comment by vidarh 4 days ago
Though it makes it harder to generate fast code, it's not impossible given that most Ruby meta programming runs early and then doesn't change the program again, and most patterns are recognisable and it seems likely to be (I'm on and off working on my own Ruby AOT compiler) possible to statically verify for most programs that after a given point most code will not change types and so do static type inference to elide most type checks (a type in such a Ruby program will not be a given class, but a given version of a given class or meta class)
Comment by ModernMech 5 days ago
https://youtu.be/XVaRRryB_cQ?si=CuXiMDdwccH6wOra&t=760
Basically he's saying static typing is needed for AI today because it's "junior level", but for senior level programmers they are more experienced so these types blend into the background; therefore when AI is a senior level in the future, it will also not require static typing to not make mistakes. That writing correct code will be as natural to the LLM as moving your arm is to you.
Comment by pjmlp 4 days ago
And in what concerns interpreted languages, they will be replaced by agentic runtimes as it is already the case in iPaaS cloud products.
Comment by todotask2 5 days ago
Comment by ksec 4 days ago
Comment by alberth 5 days ago
Comment by red-breeze 5 days ago
Comment by pelagicAustral 5 days ago
Comment by isityettime 5 days ago
Comment by ModernMech 5 days ago
Comment by isityettime 5 days ago
But I would think that as hackers, when we praise a programming language, we often have in mind virtues that are freely transportable to other programming languages; intrinsic achievements that can be learned from and applied broadly.
I want my programming languages to be lovely, concise, clear, expressive, powerful, fun, insightful, mind-bending, illustrative, flexible, convenient, well-integrated, well-founded, efficient, safe, or helpful. I don't want them to have moats. I don't want to have to say "I'm using this because I (or my industry) started using it years ago and it's sticky"; I want to be so lucky as to get to say "I'm using this because it's good"!
Maybe a minor semantic dispute in the eyes of some, maybe a kind of excessive literalism on my part, maybe a futile resistance to to concept creep, old man yelling at cloud.
But ykwim?