Cooperative Concurrency in Crystal with Fibers and Channels
Crystal schedules lightweight fibers cooperatively on a single OS thread. Learn how to pass messages between fibers with Channel(T) and avoid stalling the scheduler.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Crystal schedules lightweight fibers cooperatively on a single OS thread. Learn how to pass messages between fibers with Channel(T) and avoid stalling the scheduler.
Crystal's ? suffix makes nilability part of the type system, turning null-reference crashes into compile-time errors. Control-flow refinement narrows types after nil checks, and &. handles optional values inline. Trade-off: nilables spread through generics, increasing verbosity.
Crystal feels like Ruby but compiles to native code. Learn how its type inference works, where annotations are required, and how to read compiler errors.
Learn how to implement a high-concurrency I/O service using Crystal's cooperative fibers and channels, including strategies to avoid scheduler stalls and memory leaks.
Explore how Crystal's type inference engine provides the speed of a compiled language with the clean syntax of Ruby, and learn the trade-offs regarding compilation time.
A decision guide for handling nilable values in Crystal: compare .try, .not_nil!, explicit guards, case expressions, and the stdlib try macro with a compact trade‑off table and a runnable demo.
Learn how to balance Crystal's powerful type inference with explicit annotations to reduce compilation times and improve API clarity.
Explore how Crystal's global type inference provides Ruby-like ergonomics with static safety, and learn when to use explicit type annotations to optimize build speed and code clarity.
Learn how to diagnose and resolve NilRuntimeErrors in Crystal. This guide covers the use of --warn nilable, safe navigation with .try, and implementing robust nil guards.