days
0
-41
-9
hours
-2
0
minutes
-4
-9
seconds
-4
-9
search
Rock solid programming

Crystal 0.33.0 release: Combining elements of Ruby and C

Sarah Schlothauer
crystal
© Shutterstock / Stephen Jingel

Taking inspiration from both C and Ruby, Crystal is a programming language that is just starting to get its legs. Crystal compiles to native code, is statically type checked with built-in type inference and uses object-oriented programming concepts. The newest release, version 0.33.0 adds some language changes, standard library changes, and cleans up some issues.

We highlighted the Crystal programming language before on JAXenter and have been keeping an eye on its new releases. Here’s the scoop: it takes inspiration from the best of multiple programming languages, by combining the syntax structure of Ruby plus the efficiency and speed of C.

This means that Ruby programmers will quickly gain a foothold and find Crystal easy to write with. So if you are looking to pick up a new language, the hidden gem might be right here. Check out the language overview and see how it compares.

The latest version, 0.33.0, arrived on February 14, 2020. This Valentine’s Day update added some changes to the language and the standard library.

SEE ALSO: Coding bootcamps & YouTube: Developers in 2020 learn via non-traditional methods

New updates in 0.33.0

Version 0.33.0 is the result of 117 commits and the work of 29 contributors. Let’s take a look at some of the new additions:

  • Language change: added select/timeout language construct for select statements
  • Breaking changes: removed previously deprecated methods and modules
  • Macros: extended TypeNode#name with a new overload
  • Compiler fixes: fixed memory corruption bugs and cleaned up previously deprecated comma separators
  • Standard library change: added Object#in?
  • Numerics: added BigInt#unsafe_shrand refactoredFloat#fdiv
  • Files: Deprecated File::Info#owner, and File::Info#groupfor #owner_id, and #group_id.
  • Networking: improved OpenSSL::SSL::Socket
  • Windows improvement: added Windows CI using GitHub Actions
  • Linux change: using lld instead of ld
  • Doc generator: deprecate ditto and nodoc in favor of :ditto: and :nodoc:.
  • Serialization: improved JSON deserialization for better union types
crystal

Newly added select/timeout language construct. Source.

That’s not all; check out the changelog for the complete overview for all the changes and bug fixes.

Future plans

Where to now? For one, the language is still under heavy development, with possible breaking changes to come as it becomes more mature and reaches its goals. It is currently not production-ready yet but is well on its way.

Crystal’s design goals from its README include:

  • Have a syntax similar to Ruby (but compatibility with it is not a goal)
  • 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.

According to the announcement blog, the next update, version 0.34, will most likely include updated shards. Like all updates, if you test out version 0.33.0, be sure to offer some feedback and help improve future versions. In preparation, the dev team asks if users could test shards against Crystal nightly releases.

From the blog:

It will also be helpful if your shards are tested against Crystal nightly releases. Either Docker or Snap are the current channels to get them easily. This will help reduce the friction of a release while checking if the ecosystem is in good shape.

SEE ALSO: Architectural Patterns in the Serverless Journey of shop.LEGO.com

Installing Crystal

Want to test Crystal out? The in-browser online playground is a good place to start compiling and running your own code. (However, as of right now, the playground only goes up to Crystal v0.32.1., so not all features are up to date.)

If you like what you see, view the source code on GitHub. Installing Crystal can be done via a variety of different platforms, just follow the installation guide.

Gaze into your crystal ball; will you learn this programming language?

Author
Sarah Schlothauer

Sarah Schlothauer

All Posts by Sarah Schlothauer

Sarah Schlothauer is an assistant editor for JAXenter.com. She received her Bachelor's degree from Monmouth University and is currently enrolled at Goethe University in Frankfurt, Germany where she is working on her Masters. She lives in Frankfurt with her husband and cat. She is also the editor for Conditio Humana, an online magazine about ethics, AI, and technology.

guest
0 Comments
Inline Feedbacks
View all comments