Welcome to Crystal
Crystal is a programming language with the following goals:
- Ruby-inspired syntax.
- Never have to specify the type of a variable or method argument.
- Be able to call C code by writing bindings to it in Crystal.
- Have compile-time evaluation and generation of code, to avoid boilerplate code.
- Compile to efficient native code.
It looks like this:
# Compute prime numbers up to 100 with the Sieve of Eratosthenes max = 100 sieve = Array.new(max, true) sieve = false (2...max).each do |i| if sieve[i] (2 * i).step(max - 1, i) do |j| sieve[j] = false end end end sieve.each_with_index do |prime, number| puts number if prime end
Questions or suggestions? Ask in our Google Group or join our IRC channel #crystal-lang at irc.freenode.net
The project is in pre-alpha stage: we are still designing the language and prototying a compiler in Ruby, while at the same time writing a compiler in Crystal.