$ whois crystal
Crystal
first released in 2014 · by Ary Borenszweig, Juan Wajnerman, Brian Cardiff
$ guessprog --inspect crystal
- year
- 2014
- paradigm
- object oriented
- family
- other
- memory
- automatic gc
- binding
- static
- safety
- strong
CRYSTAL(7)
- AUTHORS
- Ary Borenszweig, Juan Wajnerman, Brian Cardiff
- HISTORY
- Ary Borenszweig, Juan Wajnerman and Brian Cardiff started Crystal in 2011 at Manas Technology Solutions in Buenos Aires, aiming to combine Ruby's elegant syntax with the speed and type safety of a compiled language. It was briefly called Joy before being renamed. The first compiler was written in Ruby, but by 2013 Crystal could compile itself. A global type inference algorithm means types are checked at compile time while rarely being written down, and version 1.0 arrived in 2021.
- USAGE
- A niche language with a small but active community, used mainly for web services, command-line tools and by Ruby developers who want native performance.
- SEE ALSO
- Crystal on Wikipedia ↗
def describe(value : Int32 | String)
case value
when Int32 then "a number, doubled: #{value * 2}"
when String then "a string, upcased: #{value.upcase}"
end
end
puts describe(21)
puts describe("crystal")
name = ENV["USER"]? # type is String | Nil
puts name.try(&.capitalize) || "anonymous"