Spoiled by Crystal's expressiveness

I noticed that the NATS project had released their latest version this past week, so I was adding support for some of the features to my Crystal NATS client. There was one feature that I’d missed from a while back so I checked how the first-party Golang client implements it.

They define an enum-like type with 2 values and their serializations, which takes up almost 50 lines of code in Go. Defining the same thing in Crystal took 4 lines of code because all I had to define is the enum itself. We get those exact serializations (both JSON and display-friendly strings) for free.

Crystal’s expressiveness is incredible, to the point where working in nearly any other programming language is actually kinda frustrating. I’ve become spoiled by how good we have it.

26 Likes

I agree 100% with you, this is why I don’t want at all to move to another language

1 Like