In this tutorial we learned about some of the optional ingredients commonly found in well-crafted Racket languages. Maybe we would skip these extra steps for a quick-and-dirty DSL like the upcoming wires. But for a language like jsonic, that we want to maintain and share, these are wise investments.
On the implementation side, we introduced:
Contracts, which wrap around functions to ensure their input arguments and return values meet our requirements.
Unit tests, which automatically check that our functions behave the way we expect them to with sample cases.
Source locations, which we preserve throughout our implementation so that our language interfaces well with other tools.
On the user side, we saw how we can customize the behavior of DrRacket for our language:
Syntax coloring, which uses a lexer to apply color categories to parts of the source code.
Indenting, which automatically reformats the code.
Toolbar buttons, which appear at the top of the DrRacket window and can have any behavior within the UI.
The last step in a language project is preparing it for distribution by setting it up as a package with documentation. We’ll cover that in the final part of our jsonic trilogy.