Crystal¶
Fast as C, slick as Ruby
Overview¶
Crystal is a compiled language with Ruby-like syntax and static type checking. It aims to combine the elegance of Ruby with the performance of C.
Language Aliases¶
run crystal "puts \"Hello\""
run cr "puts \"Hello\""
run crystal-lang "puts \"Hello\""
# Output: Hello (x3)
Multi-line Code: Use Heredoc
For multi-line code, use heredoc (<< 'EOF') to avoid shell quoting and escaping issues.
REPL Behavior¶
Crystal's REPL maintains state across commands. Variables, methods, and classes persist within the same REPL session.