| Crystal | |
|---|---|
| Paradigm | Multi-paradigm:object-oriented,concurrent |
| Designed by | Ary Borenszweig, Juan Wajnerman, Brian Cardiff |
| Developer | Manas Technology Solutions |
| First appeared | June 19, 2014; 11 years ago (2014-06-19)[1] |
| Stable release | 1.19.1 / January 20, 2026; 30 days ago (2026-01-20) |
| Typing discipline | static,inferred,nominal,duck |
| Implementation language | Crystal |
| Platform | IA-32 (i386),x86-64,AArch64[2] |
| OS | Linux,macOS,FreeBSD,OpenBSD,Windows[2] |
| License | Apache License 2.0 |
| Filename extensions | .cr |
| Website | crystal-lang |
| Influenced by | |
| Ruby,Go[3] | |
Crystal is ahigh-levelgeneral-purpose,object-oriented programming language, designed and developed by Ary Borenszweig, Juan Wajnerman, Brian Cardiff and more than 530 contributors.[4] With syntax inspired by the languageRuby,[5] it is acompiled language withstatic type-checking, but specifying the types of variables or method arguments is generally unneeded. Types are resolved by an advanced globaltype inference algorithm.[6][7] Crystal is currently in active development. It is released asfree and open-source software under theApache License version 2.0.
Work on the language began in June 2011,[8] with the aim of merging the elegance and productivity ofRuby with the speed, efficiency, and type safety of a compiled language.[9][8] Initially namedJoy, it was quickly renamed toCrystal.[8]
The Crystal compiler was first written in Ruby, but later rewritten in Crystal, thus becomingself-hosting, as of November 2013[update].[10] The first official version was released in June 2014.[11] In July 2016, Crystal joined theTIOBE index.
Although resembling the Ruby language in syntax, Crystal compiles to much more efficient native code using anLLVM backend, at the cost of precluding the dynamic aspects of Ruby. The advanced global type inference used by the Crystal compiler, combined withunion types, gives it more the feel of a higher-level scripting language than many other comparable programming languages. It has automated garbage collection and offers aBoehm collector. Crystal possesses a macro system and supports generics as well as method and operator overloading. Its concurrency model is inspired bycommunicating sequential processes (CSP) and implements lightweight fibers and channels (for interfiber communication), inspired byGo.[3]
In 2020, it was reported that the infotainment units in vehicles produced byNikola Corporation were written in Crystal.[12] Much of the backend of theKagi search engine is written with Crystal.[13]