DEV Community

Kushal
Kushal

Posted on

First Look at Crystal Programming

Today, I was exploring a new Language "Crystal Programming Language". It has more then 15k stars on GitHub as on Jan, 2021

How it all Started

It has an interesting start, It was started as an experiment by Manastech in 2012 by three members: Ary, Juan and Brian. The first official release came on Jun 18, 2014

In Ary’s own words, why Crystal Programming Language was started:

At Manas we really like Ruby and use it a lot,
but we feel a bit sad when it’s slow and
we have to migrate our code to another language.
We wished there was a language like Ruby,
only faster and more type safe.
We realized, due to Ruby’s dynamic nature,
that it would be impossible to make Ruby work like that,
so we started our own language.

As many of the things we do at Manas,
Crystal was created to solve a problem.
If it doesn’t exist, why not create it?

What is Crystal programming Language

Crystal is an Object Oriented, statically-typed and structured programming language with build-in type-checks and syntax close to Ruby, and gives performance close to c/c++.

Most Dynamic programing languages, operations can be done at compile and run time both. For example, in JavaScript it is possible to change the type of a variable or add new properties or methods to an object while the program is running. The compile-time static type checks of Crystal Programming provides an additional safety layer which proves invaluable in larger code-bases, a problem faced by several long-running projects built on dynamic languages.

As mentioned on the crystal official site, Crystal programming language focuses on

  • Have a syntax similar to Ruby (but compatibility with it is not a goal).
  • Be statically type-checked, but without having to specify the type of variables or method arguments.
  • 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.

Write Your First Program

Crystal Programming Language Influencers, Developers and Handlers

Official Links

Crystal Programming Language is impressive by first look, Will deep dive more later on some other day. Next I will be diving to First Look of Q#. Stay with me.

I explore new technologies, languages, and deep dive into the new technical topics. Thanks for staying with me.

Top comments (3)

Collapse
 
m33 profile image
M33

Crystal deserves a try... the ruby inspired style with best of class performance is a sweet mix.

Collapse
 
perfecto25 profile image
mrx

Loving crystal so far, wrote a port listener and tester with crystal, very easy syntax, as fast as C (or at least feels like it)

github.com/perfecto25/fcat

Collapse
 
why_not_how profile image
WHY, not HOW is the question!

I haven't written anything production ready with Crystal yet. but for fast prototyping and R&D, perfect!