Extensible annotation based serialization/deserialization/validation library


JSON (and later YAML) serializer and validator inspired by JMS Serializer Annotations and Symfony Validation Constraint Annotations.


  • Be a compliment to, not a replacement for, JSON::Serializable or YAML::Serializable
  • Extensible and customizable to fit all use cases
  • Make working with JSON APIs in Crystal much easier
  • Be easy to adopt and start using effectively
  • Work out of the box with most ORMs (assuming they are compatible with JSON::Serializable/annotations)

Pure-Crystal implementation of Neo4j's Bolt protocol


Crystal implementation of a Neo4j driver using the Bolt protocol.

require "neo4j"

# The `ssl` option defaults to `true` so you don't accidentally send the
# password to your production DB in cleartext.
connection = Neo4j::Bolt::Connection.new(
  ssl: false,

  MATCH (order:Order)-[:ORDERS]->(product:Product)
  RETURN order, collect(product)
  LIMIT 10

A C parser generator, written in Crystal


Pegasus is based on the UNIX philosophy of doing one thing, and doing it well. The core pegasus program isn't as much a parser generator as it is a Push Down Automaton generator.

Pegasus reads the grammar files, creates a Deterministic Finite Automaton (DFA) that is then used to tokenize (lex) text. Then, it creates an LALR(1) Push Down Automaton that is then used to parse text. However, it doesn't actually generate a parser: it outputs the generated tables for both automatons, as well as some extra information, as JSON. Another program, specific to each language, then reads the JSON and is responsible for code output.

This is beneficial because this prevents the code generator from being dependent on a language. JSON is a data interchange format, and it is easily readable from almost any programming language. If I, or others, want to add a code generation target, they can just parse the JSON in their preferred language, rather than Crystal. An additional benefit is that the addition of a target doesn't require the pegasus core to be updated or recompiled.