Crystal: Ruby syntax with almost C efficiency

Christopher Watson
HackerNoon.com

--

Everyone looks at programming languages differently. There are those that want speed and are willing to compromise syntax (I’m looking at you C++ developers), and then there are those that would rather have something that looks beautiful but lacks in performance (like Ruby). I’ve never understood why a language didn’t exist that married the two ideas into a language that was both fast, and beautiful.

Several languages have tried over the years and a few have gotten close. Go is a perfect example. Still loosely based on the C language, Go has an easier to understand and easier to read syntax without sacrificing too much on the performance end. Having been developed by Google it has also matured quickly and gained a high adoption rate. It also compiles down to machine code which means you can use it to write the same types of programs in Go where you’d normally use C. However it’s still not as beginner friendly or as easy to understand as a language like Python or Ruby.

Enter Crystal, a beautiful Ruby-esque programming language that compiles down to machine code. I stumbled upon crystal while searching for a way to make Ruby compile to machine code, or at least C, and instantly fell in love. Here are some of the things I love about Crystal:

  • It’s statically typed, but with built in type inference. That means no more…

--

--