If one listens to enough Ruby related blogs and talks and podcasts they are likely to run in to Crystal. Have you every thought, “I like Ruby, but I wish is were fast and compiled on LLVM”? Well, that’s Crystal. It’s a fast language with Ruby inspired syntax. If the performance benchmarks shown on the Crystal site are even remotely accurate, it’s worth checking out.
I enjoy writing Ruby and I like things that are fast, so I’ve been trying it out. While it is still pre-1.0 it’s been pretty nice to work with. And since it’s a new language, there’s an opportunity to write new libraries (known as “Shards” in Crystal).
My first Crystal Shard has been a money handling library, inspired by Ruby Money, that I call Moola. It gives uses the ability to define Money objects and do basic operations and conversions with them. Here are a few examples:
I don’t have much to say other than it seems like a great language if you like writing Ruby. For a newer language it’s been a joy to work with and it’s fun to build some basic libraries.
If you every find yourself writing Ruby and dealing with money, I encourage you to try out Moola.