Crystal’s syntax is heavily inspired by Ruby’s, so it feels natural to read and easy to write, and has the added benefit of a lower learning curve for experienced Ruby devs.
Crystal is statically type checked, so any type errors will be caught early by the compiler rather than fail on runtime. Moreover, and to keep the language clean, Crystal has built-in type inference, so most type annotations are unneeded.
Null reference checks
All types are non-nilable in Crystal, and nilable variables are represented as a union between the type and nil. As a consequence, the compiler will automatically check for null references in compile time, helping prevent the dreadful billion-dollar mistake.
Running the previous file:
Crystal’s answer to metaprogramming is a powerful macro system, which ranges from basic templating and AST inspection, to types inspection and running arbitrary external programs.
Crystal uses green threads, called fibers, to achieve concurrency. Fibers communicate with each other using channels, as in Go or Clojure, without having to turn to shared memory or locks.
Crystal has a dedicated syntax to easily call native libraries, eliminating the need to reimplement low-level tasks.
Crystal libraries are packed as Shards, and distributed via Git without needing a centralised repository. Built in commands allow dependencies to be easily specified through a YAML file and fetched from their respective repositories.
Articles from our blog
Crystal Automated Release
Lucky with Crystal - Fewer Bugs, Better Performance, Incredible Productivity
Amber - Crystalizing Rails and Phoenix
|Crystal 0.24.2 released!||09 Mar 2018|
|Crystal 0.24.1 released!||23 Dec 2017|
|Crystal 0.23.1 released!||13 Jul 2017|
|Crystal 0.23.0 released!||29 Jun 2017|
|Crystal 0.22.0 released!||01 Apr 2017|
|Crystal 0.21.0 released!||21 Feb 2017|
|Crystal 0.20.5 released!||22 Jan 2017|
|Crystal 0.20.4 released!||07 Jan 2017|
|Crystal 0.20.3 released!||24 Dec 2016|
|Crystal 0.20.1 released!||06 Dec 2016|