Crystal (programming language)

Object-oriented programming language From Wikipedia, the free encyclopedia

Crystal is a high-level general-purpose, object-oriented programming language, designed and developed by Ary Borenszweig, Juan Wajnerman, Brian Cardiff and more than 530 contributors.[5] With syntax inspired by the language Ruby,[6] it is a compiled language with static type-checking, but specifying the types of variables or method arguments is generally unneeded. Types are resolved by an advanced global type inference algorithm.[7][8] Crystal is currently in active development. It is released as free and open-source software under the Apache License version 2.0.

DesignedbyAry Borenszweig, Juan Wajnerman, Brian Cardiff
DeveloperManas Technology Solutions
FirstappearedJune 19, 2014; 11 years ago (2014-06-19)[1]
Quick facts Paradigm, Designed by ...
Crystal
ParadigmMulti-paradigm: object-oriented, concurrent
Designed byAry Borenszweig, Juan Wajnerman, Brian Cardiff
DeveloperManas Technology Solutions
First appearedJune 19, 2014; 11 years ago (2014-06-19)[1]
Stable release
1.19.1[2] Edit this on Wikidata / 20 January 2026; 47 days ago (20 January 2026)
Typing disciplinestatic, inferred, nominal, duck
Implementation languageCrystal
PlatformIA-32 (i386), x86-64, AArch64[3]
OSLinux, macOS, FreeBSD, OpenBSD, Windows[3]
LicenseApache License 2.0
Filename extensions.cr
Websitecrystal-lang.org Edit this at Wikidata
Influenced by
Ruby, Go[4]
Close

History

Work on the language began in June 2011,[9] with the aim of merging the elegance and productivity of Ruby with the speed, efficiency, and type safety of a compiled language.[10][9] Initially named Joy, it was quickly renamed to Crystal.[9]

The Crystal compiler was first written in Ruby, but later rewritten in Crystal, thus becoming self-hosting, as of November 2013.[11] The first official version was released in June 2014.[12] In July 2016, Crystal joined the TIOBE index.

Description

Although resembling the Ruby language in syntax, Crystal compiles to much more efficient native code using an LLVM backend, at the cost of precluding the dynamic aspects of Ruby. The advanced global type inference used by the Crystal compiler, combined with union 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 a Boehm collector. Crystal possesses a macro system and supports generics as well as method and operator overloading. Its concurrency model is inspired by communicating sequential processes (CSP) and implements lightweight fibers and channels (for interfiber communication), inspired by Go.[4]

Adoption

In 2020, it was reported that the infotainment units in vehicles produced by Nikola Corporation were written in Crystal.[13] Much of the backend of the Kagi search engine is written with Crystal.[14]

Further reading

  • St. Laurent, Simon; Balbaert, Ivo (February 1, 2019), Programming Crystal (P1.0 ed.), Pragmatic Bookshelf, ISBN 978-1-68050-286-2
  • Dietrich, George; Bernal, Guilherme (May 27, 2022), Crystal Programming, Packt Publishing, ISBN 978-1801818674
  • Wartala, Ramon (March 2016), "Die Ruby-artige Programmiersprache Crystal" [The Ruby-like programming language Crystal], Linux Magazin (in German), no. 3/2016, ISSN 1432-640X

References

Related Articles

Wikiwand AI