Crystal for Rubyists
In this book, we’ll talk about why you should care about Crystal, how to get up and running, the basics of writing software in Crystal, and maybe even something like building a Ruby gem with Crystal.
NOTE: While this book is called ‘Crystal for Rubyists,’ it should be accessible to anyone who knows about OOP and programming in a dynamically typed language. Analogies will be made that will make the most sense to Rubyists, but you can still get a lot out of this book if you are a programmer of a different sort. If your favorite language is static, then you’re already ahead of the game. You can just disregard a lot of the analogies.
You already write software in Ruby. It pays your bills. You enjoy it. Why should you care about Crystal?
Let’s think about Ruby for a minute: what’s its biggest weakness?
What’s awesome about Ruby?
- Vaguely functional
- Syntax is pretty easy
- Focus on developer happiness
- Get up and running quickly
- Dynamically typed
So we could learn a lot from a language that’s easy as Ruby, handles concurrency well, and is fast. We don’t want to sacrifice anonymous functions, pretty syntax, or not making ‘AbstractFactoryFactoryImpls’ just to get work done.
That language is Crystal.
Now, Crystal is not perfect. It is getting better. But the point is to learn. and using a language that’s very familiar, yet very different, can teach us a lot.