Skip to content
Crystal
Guides
English
日本語
Initializing search
GitHub
Welcome
Specification
Guides
Tutorials
Manuals
Crystal
GitHub
Welcome
Specification
Specification
About this guide
The Program
Comments
Documenting code
Literals
Literals
Nil
Bool
Integers
Floats
Char
String
Symbol
Array
Hash
Range
Regex
Tuple
NamedTuple
Proc
Command
Assignment
Local variables
Control expressions
Control expressions
Truthy and falsey values
if
if
As a suffix
As an expression
Ternary if
if var
if var.is_a?(...)
if var.responds_to?(...)
if var.nil?
if !
unless
case
select
while
while
break
next
until
&&
||
Requiring files
Types and methods
Types and methods
Everything is an object
Classes and methods
Classes and methods
new, initialize and allocate
Methods and instance variables
Type inference
Union types
Overloading
Default parameter values and named arguments
Splats and tuples
Type restrictions
Return types
Method arguments
Operators
Visibility
Inheritance
Inheritance
Virtual and abstract types
Class methods
Class variables
finalize
Modules
Generics
Structs
Constants
Enums
Blocks and Procs
Blocks and Procs
Capturing blocks
Proc literal
Block forwarding
Closures
alias
Exception handling
Type grammar
Type reflection
Type reflection
is_a?
nil?
responds_to?
as
as?
typeof
Type autocasting
Macros
Macros
Macro methods
Hooks
Fresh variables
Annotations
Annotations
Built-in annotations
Low-level primitives
Low-level primitives
pointerof
sizeof
instance_sizeof
alignof
instance_alignof
offsetof
Uninitialized variable declaration
asm
Compile-time flags
Compile-time flags
Cross-compilation
C bindings
C bindings
lib
fun
fun
out
to_unsafe
struct
union
enum
Variables
Constants
type
alias
Callbacks
Unsafe code
Guides
Guides
Performance
Concurrency
Testing
Writing Shards
Writing Shards
Hosting on GitHub
Hosting on GitLab
Continuous Integration
Continuous Integration
GitHub Actions
CircleCI
Static Linking
Crystal for Rubyists
Crystal for Rubyists
Metaprogramming Help
Database
Database
Connection
Connection pool
Transactions
Coding style
Runtime Tracing
Tutorials
Tutorials
Getting started
Getting started
An HTTP Server
A Command Line Application
Language introduction
Language introduction
Hello World
Variables
Math
Strings
Control Flow
Methods
Manuals
Manuals
Using the Compiler
The Shards Command
Required libraries
Platform Support
Release Policy
Guides
¶
Read these guides to get the best out of Crystal.