mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
f0e5bed36f
* DAML-LF: Add interning for type to DAML-LF 1.dev We add two new features to DAML-LF 1.dev: * a per package list (or table) of `Type` messages, and * a new case in the `Type` message which is an index into this table. In combination, these two features can be used to allow DAML-LF encoders to perform hash-consing of `Type` messages. We also change the Haskell implementation of our DAML-LF encoder to do exactly that when targetting DAML-LF 1.dev. Doing this has a few benefits: 1. The DALFs produced by `damlc` get smaller: I've seen a case where the size dropped from 69MB to 45MB. 2. DAML-LF decoders need to decode less data. 3. Decoded packages use less memory because identical structures are now shared. This is particularly helpful in situations where we need to keep the interface (or signature) of a package in memory for a long time. This PR mostly takes care of the Haskell implementation. However, we need to make the Scala implementation of the decoder aware of the new features as well since we have tests that load DAML-LF 1.dev into the engine. A decoder and _targeted_ tests on the Scala side will follow in a separate PR. CHANGELOG_BEGIN CHANGELOG_END * Make jq tests aware of type interning CHANGELOG_BEGIN CHANGELOG_END * Improve jq test CHANGELOG_BEGIN CHANGELOG_END * Apply Remy's suggestions Co-authored-by: Remy <remy.haemmerle@daml.com> * Improve the imperative bits CHANGELOG_BEGIN CHANGELOG_END Co-authored-by: Remy <remy.haemmerle@daml.com> |
||
---|---|---|
.. | ||
src | ||
tests | ||
BUILD.bazel | ||
da-hs-base.cabal | ||
LICENSE | ||
README.md |
Base library for DA Haskell code
The libraries provided by Hackage adapted to the needs of DA.
The intention of this version of this library published as part of Simon Meier's HaskellerZ talk on 2016-01-27 is that it serves as an inspirational source for how to adapt Hackage to a company's needs. DA currently does not plan to provide an officially supported version of this library. However, we very much encourage people to take and reshape this code into a library that allows to share this kind of Hackage-adaption-code.