Crystal 0.33.0 release: Combining elements of Ruby and C
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.
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/timeoutlanguage construct for select statements
- Breaking changes: removed previously deprecated methods and modules
- Macros: extended
TypeNode#namewith a new overload
- Compiler fixes: fixed memory corruption bugs and cleaned up previously deprecated comma separators
- Standard library change: added
- Numerics: added
- Files: Deprecated
- Networking: improved
- Windows improvement: added Windows CI using GitHub Actions
- Linux change: using
- Doc generator: deprecate
nodocin favor of
- Serialization: improved JSON deserialization for better union types
That’s not all; check out the changelog for the complete overview for all the changes and bug fixes.
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.
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.)
Gaze into your crystal ball; will you learn this programming language?