Note: There is a performance regression in the Daml Driver for Postgres that is now fixed and noted in Daml Connect 1.13.1 release. Daml Connect 1.13.0 is no longer supported.
Daml Connect 1.13.0 has been marked stable on Wednesday May 12th. You can install it using:
daml install latest
Want to know what’s happening more broadly among Daml developers? Check out the latest Daml Developer Monthly.
Daml Connect 1.13 is primarily a usability and bugfix release, but also introduces several features in Early Access for the first time:
BigNumeric
, a new Daml data type for arbitrary precision arithmetic is now available in Beta.Impact and Migration
This release is almost entirely additive. Its main purpose is to allow you to benefit from recent fixes and try out upcoming features in Early Access.
The only change for which we recommend action is that the InsertOrdMap
type in the Scala bindings is now deprecated. This used to be how the Scala Codegen represented the Daml GenMap
type. We recommend using the provided Primitive.GenMap
type instead.
Background
Daml is designed with safety and usability in mind, trying to make it as easy as possible to build confidence in written code. One property of the language that is firmly on the safety side is that all data is immutable. With Daml’s record dot syntax, a feature that was ultimately upstreamed into the Glasgow Haskell Compiler, we invested heavily in also providing usability via familiar access patterns. With record dot updates, the same usability is now coming to data manipulation.
Specific Changes
Nested record fields can now be updated in an intuitive way:
data X = X with
a : Y
data Y = Y with
b : Int
beforeRecordDotUpdates : X -> X
beforeRecordDotUpdates x = x with
a = x.a with
b = 1
withRecordDotUpdates : X -> X
withRecordDotUpdates x = x with a.b = 1
Impact and Migration
This is primarily a usability improvement, but if you are using advanced programming techniques like lenses to accomplish the same thing, we recommend switching. Record dot updates have significantly better performance characteristics.
Background
Daml’s inbuilt Decimal
and Numeric
data types are fixed point numbers with a fixed precision of 38 decimals. In some numeric applications, they can require careful management of scale, or pre-condition checking to preserve the required precision in calculations.
The new BigNumeric
removes this burden from the developer by allowing them to specify an arbitrary precision that is used for any intermediary results.
Specific Changes
--target=1.13
.BigNumeric
. BigNumeric represents any positive or negative decimal number with up to 2^15 digits before the decimal point, and up to 2^15 digits after the decimal point.BigNumeric
to a fixed-width 128-bit decimal Numeric n
in order to store it in a template.BigNumeric
is used via conversion functions fromNumeric
and fromBigNumeric
to convert between BigNumeric
and Numeric n
, which includes the alias Decimal == Numeric 10
.DA.BigNumeric
provides functions for division and rounding.Impact and Migration
If you have calculations with critical and hard to manage precision, we recommend trying out BigNumeric
and preparing your project for the stable release of this feature in an upcoming release.
Background
A common task both during development as well as production debugging, support, or maintenance is to extract part of the state or history of a system for further processing or analysis.
With Daml Script, we have a single format that can be imported in the IDE, Sandbox and production ledgers already. It is Daml’s equivalent of SQL scripts.
Daml Script Exports provide the export counterpart, providing a single flexible way to move ledger data between different production and development environments.
Specific Changes
daml ledger export script
, which allows you to extract ledger history for a set of parties into a Daml Script. See documentation for full use and caveats. Sample use:daml ledger export script --host localhost --port 6865 --party Alice --party Bob --output ../out --sdk-version 1.13.0
Impact and Migration
This is the first alpha version of a new, entirely additive feature. If you try it out, we’d love to hear your feedback and ideas on how to make it as useful as possible, for example via the Daml forum.
Background
We are working to give users of the Enterprise Editions of Daml Connect and Drivers more choice in the underlying databases they use for local persistence. The addition of Oracle Database support in Daml Connect goes hand in hand with the Daml Driver for Oracle Database, which was also released in Alpha recently.
Specific Changes
Impact and Migration
This feature is purely additive and can be tried out. It is not yet ready for production use and should not be relied upon at this point.
daml build
accepts a new flag --access-token-file
. It accepts a path to an access token to authenticate against the ledger API. This is needed if the project depends on a remote Daml package hosted on such a ledger with authentication. The path to the token can also be specified in the daml.yaml
project file under the ledger.access-token-file
field.daml packages list
command has been added to the Daml Assistant. It lists packages deployed on a remote Daml ledger.InsertOrdMap
type. The type continues working, but we recommend switching to the Primitive.GenMap
type instead. useStreamFetchByKey
and useStreamFetchByKeys
functions in the JS @daml/react
library now correctly expose the closeHandler
of the underlying @daml/ledger
library. Their docstrings have also been corrected. Thanks to Huw for reporting this issue on the forum.WriteService.submitTransaction
method to support distributed tracing.BigNumeric