Run Crystal online — Ruby-like syntax, static types, native performance.
Crystal reads like Ruby but compiles to native code with type inference across the whole program. If you like Ruby ergonomics and want C-adjacent performance, this is the direct path.
ls-judge compiles Crystal 1.x with the standard compiler inside a Firecracker microVM. Cold compile times matter here — the timeout budget accommodates them.
Clicking "Run now" opens the playground with this exact code and a matching test case pre-loaded — passes on first Run.
n = gets.not_nil!.chomp.to_i
puts n * 2
21
42