package catala

  1. Overview
  2. Docs
Low-level language for tax code specification

Install

Dune Dependency

Authors

Maintainers

Sources

0.3.0.tar.gz
md5=4a2c5495f30d8fc2e3bf977df6e602f9
sha512=8dcc404b6068b9dbd76982ade60d8fba1950fdd0a8a626db17429120483367dce1f51997e96d7b8ee5308f305c3bcbb897ef85336f25e9ef3681f4cb9237f56a

doc/utils.html

Compiler utilities

Unique identifiers

Related modules:

  • Utils.Uid Global identifiers factories using a generative functor

In the desugared representation or in the the scope language, a number of things are named using global identifiers. These identifiers use OCaml's type system to statically distinguish e.g. a scope identifier from a struct identifier.

The Utils.Uid module provides a generative functor whose output is a fresh sort of global identifiers.

Source code positions

Related modules:

This module is used throughout the compiler to annotate the abstract syntax trees with information about the position of the element in the original source code. These annotations are critical to produce readable error messages.

Error messages

Related modules:

Error handling is critical in a compiler. The Catala compiler uses an architecture of error messages inspired by the Rust compiler, where error messages all correspond to the same exception. This exception carries messages and positions that are displayed in the end in a nicely-formatted error message.

Hence, all error thrown by the compiler should use Utils.Errors

OCaml

Innovation. Community. Security.