Crystal combines the elegant and expressive syntax of Ruby with the speed and type safety of a compiled language. Crystal supports advanced type inference, macros and makes writing concurrent code easy and safe.
Elevate your Crystal skills through 145 curated exercises across 24 core concepts. Master problem-solving with a structured learning path designed for modern developers.
Crystal is a compiled, object-oriented programming language. These are some of the language's goals:
Ruby-inspired syntax.
Statically type-checked but without having to specify the type of variables or method arguments.
Be able to call C code by writing bindings to it in Crystal.
Have compile-time evaluation and generation of code, to avoid boilerplate code.
Compile to efficient native code.
Simple Syntax
Crystal's syntax is heavily inspired by Ruby, so it is natural to read and easy to write.
Static Type Checking
Crystal is statically type checked with built-in type inference, so type errors are caught early.
Null Reference Checks
All types are non-nilable in Crystal, so the compiler checks for null references at compile time.
Concurrency Model
Crystal has built in concurrency primitives, called fibers, to achieve concurrency.
C-Interopability
Crystal has dedicated syntax to easily call native libraries, increasing code re-use.
Macros
Crystal's answer to metaprogramming is a powerful macro system.
Simple Syntax
Crystal's syntax is heavily inspired by Ruby, so it is natural to read and easy to write.
Static Type Checking
Crystal is statically type checked with built-in type inference, so type errors are caught early.
Null Reference Checks
All types are non-nilable in Crystal, so the compiler checks for null references at compile time.
Concurrency Model
Crystal has built in concurrency primitives, called fibers, to achieve concurrency.
C-Interopability
Crystal has dedicated syntax to easily call native libraries, increasing code re-use.
Macros
Crystal's answer to metaprogramming is a powerful macro system.