github CatalaLang/catala 1.3.0
Version 1.3.0 - Syndicat général des ingénieurs-conseils

4 hours ago

This release of Catala is dedicated to the Syndicat général des ingénieurs-conseils case of French administrative law, which confirms that the autonomous regulatory power of the State created by the Constitution of October 4th, 1958 is still subject to the General Principles of French administrative Law.

This release focuses on scaling up the build system and text editor tooling to handle large projects. As always, all the features are documented in the Catala book. See also the catala-language-server sister release for the details of the release on the side of the language server and VSCode plugin.

New features

⚠️ Breaking change: directory inclusion in Catala projects

The behavior of include_dirs in clerk.toml changes as of this release : you are no longer forced to list all directories containing Catala source files! From now on, include_dirs looks for source files recursively into the directories you list, and is even optional, since by default clerk starts from the project root. You can also exclude some directories to speed up clerk's scanning using exclude_dirs (useful if you have a large assets directory in your project).

See the related documentation

Target separation and dependencies

Before 1.3.0, clerk's behavior and configuration files were built around the assumption that what users wanted out of a Catala project was a self-containing bundle of target source files that you could embed in a larger application as a trusted core. However, as Catala's industrialisation progresses, our users brought up the need for a single Catala project to generate multiple target packets that depend from one another.

Now, targets in clerk.toml can declare dependencies to other targets, making sure source files are bundled separately into each different targets, even if they depend on each other. This behavior comes with a major refactoring of clerk's internal dependency management, and now clerk is able to display meaningful error messages in case of cyclic dependencies between modules, etc. And it even spits out a graph to help debugging! Overall, you should also expect faster builds due to better caching.

See the related documentation

Dependency graph for catala-examples, with modules grouped by targets

Improved backend target generation

Along with our new dependency mechanism in place, we also worked toward improving the generated exportable backend code. Previously, building a target would copy over all Catala modules in the dependency chain which could cause some clashes when building multiple targets.

We now only copy over the necessary Catala modules and, if a target declares a dependency, we add a reference to it instead of duplicating the files.

Moreover, for each backend target generation, we also generate a standard build script (Makefile for C, maven for Java, etc.) that are also aware of the dependencies between targets and provide a simple way of building the generated libraries. The Catala runtime and standard library are provided alongside the user's targets in a single libcatala package.

Also, the Java backend, compatible with Java 17, now correctly sport their package declaration (and dependent target imports statements).

Finally, it is also possible to generate a .jar file per target when calling mvn package in the target directory (jar source files are also available in the build artifacts).

See the related documentation

Improved tracing

Catala's trace generation mechanism is now accessible through clerk run --trace, and you can use --trace-format=json to output the trace in a handy JSON format that you can inspect automatically in a larger IT application. The JSON format of the trace, which has been revamped and improved to better describe function calls and exceptions handling, is now the cornerstone of auditability and explainability of Catala executions. We expect new visualisations tools to be built upon it in the coming months :)

The trace generation is also available in the generated code for Java, Python and OCaml (not C yet), and each of those backends can export a JSON from the trace recorded by the generated code. Traces recorded by the generated code should be identical to interpreter-generated traces, ensuring replication of results across development and production environments for Catala.

Fixes and small improvements

  • Escape non-ascii characters in Java backend strings as unicode. All Java strings are now agnostic of encodings.
  • Fixes a bug in the --gen-external template generator where the generated OCaml code did not match the ExternalType functor signature: equal and compare were missing the _pos parameter, and from_json had incorrect signature _pos t instead of _pos _s.
  • Fixes a bug in the JSON output format of enumerations yielding errors such as:
    Invalid_argument("Json_encoding.construct: consequence of non exhaustive Json_encoding.string_enum and
    Invalid_argument("Json_encoding.construct: consequence of bad union")
  • New lint warning for local variables (let ... in) that are never used.

Contributor's log

New Contributors

Full Changelog: 1.2.0...1.3.0

Don't miss a new catala release

NewReleases is sending notifications on new releases.