February 21, 2024

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

Mastering a new programming language can open up your brain in means you by no means assumed attainable. Just like finding out a new human language like Spanish or Mandarin, you study to assume with different terms and buildings.

You faucet into the cultures and communities of the speakers and understand how they see the entire world. It’s enriching, to say the the very least.

The neat detail about programming languages is that the very first a single you master is often the toughest. At the time you comprehend fundamental structures like if-clauses and for-loops, you will see them popping up in a lot of new languages you may find out.

Find the long term of tech!

Join us at TNW Conference June 15 & 16 in Amsterdam

And, as opposed to human languages, new programming languages are substantially more quickly to find out. They are far more reasonable and have significantly less terms — or, must I say, instructions.

It follows that most programmers and information researchers master much more than one particular programming language.

They may well have a major or favorite just one. But most application builders I know use at least 5 languages on a weekly basis, if you depend scripting languages in.

Most programmers also consider to learn a new language every so frequently.

It arrives with the position. Coding means remaining curious.

The situation for Crystal

Crystal, as for every its advertisement, is a language that’s fast like C and slick like Ruby.

The component about its slickness is real. It is compiled and statically typed, which comes with its possess pros and drawbacks. Previously mentioned all, on the other hand, it is quite similar to Ruby in its fashion.

Individually I have in no way composed a greater undertaking in Ruby. But as a rather skilled Python developer, Crystal code nevertheless appears to be like crystal distinct!

Here’s an instance of a recursive loop that calculates factorials:

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