Courses/Crystal Programming/Introduction to Crystal

Introduction to Crystal

Learn Crystal - fast as C, slick as Ruby

Intermediate⏱️ 35 minutes

Lesson Content

Introduction to Crystal

Crystal is a statically-typed, compiled language with Ruby-like syntax that aims for the performance of C.

Key Features:

  • Ruby-inspired syntax
  • Statically typed
  • Compiled to native code
  • C-like performance
  • Type inference

Hello World:

puts "Hello, Crystal!"

Variables:

name = "Crystal"
age = 13
pi = 3.14159
is_fast = true

Arrays and Hashes:

numbers = [1, 2, 3, 4, 5]
person = {
  "name" => "Alice",
  "age" => 30
}
crystal
Loading...
Next (Complete this lesson first)
Crystal Functions and Classes