Learning a new programming language can open your mind in ways you never thought possible.

You tap into the cultures and communities of the speakers and learn how they see the world.

Its enriching, to say the least.

If Python is too slow for you, Crystal could be your savior

The neat thing about programming languages is that the first one you learn is always the hardest.

And, unlike human languages, new programming languages are much faster to learn.

Theyre more logical and have less words or, should I say, commands.

Factorial calculation in Crystal. Image by author, code taken from Crystal by Example

40% off TNW Conference!

They might have a main or favorite one.

Most programmers also attempt to learn a new language every so often.

If-clauses in Crystal. Image by author, code taken from Crystal by Example

It comes with the job.Codingmeans staying curious.

The case for Crystal

The part about its slickness is true.

Its compiled and statically typed, which comes with its own advantages and disadvantages.

Above all, however, its very similar to Ruby in its style.

Personally Ive never written a larger project in Ruby.

But as a fairly experiencedPythondeveloper, Crystal code still looks crystal clear!

Its basically a bad-taste version of print in other languages.

There are some subtle differences between puts and print but we wont dive into these here.

Apart from that, this example looks quite pythonic, right?

Generally speaking, thesyntax of Crystal is clear, even when dealing with larger and more complicated problems.

Thats because Crystal only requires you to specify the pop in of a variable if its ambiguous.

This practice, of course, helps programmers be more productive.

Macros

Statically typed languages tend to be finicky around macros.

Crystal, however, has a way with them.

take a stab at do this in C++ and youll either fail or need 500+ lines of code.

Or dont you, you genius?

Let me know if Im wrong…

This does come with some caveats because, as the saying goes, with great power comes great responsibility.

No Nil-errors

Speaking of safety, Crystal does have additional safeguards elsewhere.

Nil is a separate bang out for the Crystal compiler.

However, Crystals moment of fame didnt last very long.

Because of its early rise in popularity, some people hoped it could seesimilar levels of popularityas Rust.

This, however, hasnt materialized.

Programmers haveexpressed frustrationabout sample projects or code bases.

Also, the documentation seems a little bit incomplete.

This turned new programmers off in droves.

There just arent so many answers on StackOverflow, GitHub, and the likes.

However, most of the time, Crystal takes abouttwice as long to executeas C does.

And, to be fair, half as fast as C is still pretty fast.

Nevertheless, Crystal significantly under-delivers vis-a-vis its original promise.

Its so glaringly obvious that I cant blame the average developer for feeling disappointed.

Many programmers feel similar.

Crystal has had its shot at mainstream appeal, but overall it has failed in the last few years.

This doesnt mean that there arent some interesting use cases for Crystal.

It might be an interesting option for people working with blockchain technology.

you’re free to create afairly powerful cryptocurrencywith Crystal.

If you want to play with a language like Crystal, youd better bring some experience.

Because when youre faced with a problem, there might be nobody there to help you.

This article was written by Ari Joury and was originally published on Medium.

you’re free to read ithere.

Also tagged with