Batteries Included

Crystal comes with a lot of tooling baked in to help you get started quickly on projects. Because the compiler is smart enough to catch many errors, Crystal has effectively already written many of the input tests you’d need to write when coding in dynamic languages. Nevertheless, the Crystal standard library contains a Spec module supporting unit testing and Behavior-Driven Development. It even has the look and feel of RSpec, the well-known BDD framework in Ruby.

Here’s an overview of what’s included:

  • Project creation tools with ready-made code templates and spec testing.

  • Dependency management, which offers easy automated inclusion of external packages (called shards: a pun on Crystal and shared library).

  • A code formatter (format) so that all code is standardized and easily recognizable, avoiding zealous code format discussions.

  • A documentation generator (docs) that uses the Markdown format.

  • An elegant, local web-based environment for working with code, called the Crystal playground,[19] containing tools for exploring the code, like showing context and types.

The standard library supports modern needs, containing, for example, JSON parsing, Crypto, HTTP clients and servers, Websockets, OAuth2, and database drivers. This is enriched by a whole ecosystem of more than 2200 shards (these are Crystal’s libraries or packages), produced by a vibrant community.

Deploying a Crystal app is also super easy: just copy the executable to the target system. No need to install a dedicated runtime, and no problems with Crystal code dependencies.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.7.240