Commit Graph

189 Commits

Author SHA1 Message Date
Sofia Faro
abb7142072
Update LF spec for exceptions. (#9784)
* Update LF spec for exceptions.

The changes here are:

* Removing the built-in exception types
* Changing the result in the operational semantics to include both an "exception thrown" case and a "fatal error" case.
* Cleaning up the semantics of create/exercise/etc and try/catch.

Not included in this PR is anything to do with built-in arithmetic exceptions. There's room to add it in the future (as a value of AnyException type), but I would do it in a follow-up PR.

changelog_begin
changelog_end

* finish renaming Throw cases

* Update type ordering for AnyException.
2021-05-25 10:33:44 +00:00
Miklos
f5c84a2aa4
Daml-LF: Damlification of Scala/Haskell files (#9666)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-20 09:52:33 +02:00
Remy
fcbba1cd95
LF: rename convertion builtins to be more obvious (#9716)
The name of some builtins will be exposed as part of the Exception
message. This PR, try to make conversion builtins more consistent and
more obvious, before we could not rename those.

This is part of #8020

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-19 10:11:26 +00:00
Remy
a6c7b86afc
LF: Drop support of TO_QUOTED_TEXT_PARTY (#9721)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-18 21:29:04 +02:00
Remy
679ce3b7d3
LF: Release LF 1.13 (#9705)
CHANGELOG_BEGIN

- LF: make LF 1.13 stable
   Add support for BigNumeric

- Ledger API: Bump Ledger API version for LF 1.12

CHANGELOG_END
2021-05-18 17:30:34 +02:00
Remy
fc745f2224
LF: clean shifting BigNumeric builtin (#9704)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-17 19:26:14 +02:00
Moritz Kiefer
22b36b0b01
Include byKey in LF transaction spec (#9642)
changelog_begin
changelog_end
2021-05-11 14:19:36 +02:00
Sofia Faro
1d47b27304
Update LF spec transaction structure. (#9510)
Just some small changes to take into account the new ledger model transaction structure (see #9396). This PR doesn't fix all the issues with the LF spec not matching the ledger model, but it tries to avoid widening that gap.

* Removed itr, iexercise which we don't need.
* Removed the exception type and value from the rollback node.
* We're not calling rollback nodes ledger actions anymore, so separate it out.

Part of #8020

changelog_begin
changelog_end
2021-04-28 09:23:53 +01:00
Remy
2dc09ba2de
LF: fix contract ID freshness check (#9370)
Local contract IDs are collected in exercise children during preprocessing transaction for replay.

CHANGELOG_BEGIN
- [Engine] Fix contract ID freshness check when validating transaction
CHANGELOG_END
2021-04-13 18:45:44 +02:00
Sofia Faro
1627b70427
Pattern matching for RoundingMode (#9381)
* Pattern matching for RoundingMode

- Fix the order of RoundingMode constructors in GHC.Types to match the LF built-in order. Try to match this order across all code and documentation, and added a test for this order.
- Implements pattern matching for RoundingMode. The added machinery could also be useful for solving #5753 in the future.
- Implements Show instance for RoundingMode. (Mainly so we can use them in tests.) Moved BigNumeric Show instance to GHC.Show.

changelog_begin
changelog_end

* mkScrutineeEquality typo

* fix roundingModeLiteralMap order

* Use custom type for building case body

* Factor GeneralisedCaseAlternative into GeneralisedCasePattern

* Fix finalize

* Remove unused bindings
2021-04-13 15:47:16 +00:00
Remy
568a8528a8
LF: release preview of LF 1.13 (#9329)
CHANGELOG_BEGIN
- Daml: (Early access) add support for BigNumeric
CHANGELOG_END
2021-04-07 12:42:54 +02:00
Remy
74956e2459
LF: BigNumeric spec. (#8899)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-04-06 17:08:01 +02:00
Remy
70379d4e85
LF: Experiment Hook for 1.dev (#9051)
This PR adds a hook in the compiler and the engine to allow easy prototyping of new features.

In particular by using this hook, one can add a new feature in 1.dev with modifying:

    compiler
    type checkers (both Haskell and Scala)
    archive Protobuf
    archive decoder

In addition of development speed, this also adds a bit of confidence, as the peaces enumerated above are not touched when adding the feature: The feature can be added by modifying only 1.dev Daml standard library and Speedy.

aa7991f8 shows a use case of this hook.

CHANGELOG_BEGIN
CHANGELOG_END
2021-03-11 21:36:49 +01:00
Remy
a9b035e92e
LF: release LF 1.12 (#8856)
CHANGELOG_BEGIN

    - [LF] Release LF 1.12. This version reduce the size of transaction

    - [Compiler]: Change the default LF output from 1.8 to 1.11.

CHANGELOG_END
2021-02-24 21:17:33 +01:00
Remy
218f65ef6c
LF: update transaction and value spec for LF 1.12 (#8648)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-29 11:29:00 +01:00
Remy
83496abf62
LF: cleanup value.rst and transaction.rst (#8644)
Clean up as of version 11.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-28 18:03:48 +01:00
Sofia Faro
438c204fc4
Add choice observers in LF spec. (#8592)
* Add choice observers in LF spec.

Part of #7709. Adds choice observers to the syntax, type system, and
and operational semantics of LF. Adds a test for the operational
semantics of choice observers.

changelog_begin
changelog_end

* typo

* remove duplicate rule

* Always have choice observers

* Add comment in serialization section
2021-01-22 13:10:41 +00:00
Remy
53ab426119
LF: Release LF 1.11 (#8562)
CHANGELOG_BEGIN

- [Daml-LF] Release LF 1.11
  - add suport for Generic Map
  - add support for choice observer
  - add generic comparison
  - add convert of contract ID to string (available only in off-ledger mode)
  - reduce size of dar using type interning

CHANGELOG_END
2021-01-21 14:27:37 +01:00
Sofia Faro
37dcefe530
Update LF spec for exceptions. (#8530)
* Update LF spec for exceptions.

changelog_begin
changelog_end

* typo
2021-01-19 10:14:33 +00:00
Bernhard Elsner
cda93db944
Daml case and logo (#8433)
* Replace many occurrences of DAML with Daml

* Update docs logo

* A few more CLI occurrences

CHANGELOG_BEGIN
- Change DAML capitalization and docs logo
CHANGELOG_END

* Fix some over-eager replacements

* A few mor occurrences in md files

* Address comments in *.proto files

* Change case in comments and strings in .ts files

* Revert changes to frozen proto files

* Also revert LF 1.11

* Update get-daml.sh

* Update windows installer

* Include .py files

* Include comments in .daml files

* More instances in the assistant CLI

* some more help texts
2021-01-08 12:50:15 +00:00
Remy
c49f319a6f
LF Spec: fix ordering of contract IDs. (#8389)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-06 14:33:20 +01:00
Remy
cdd9e36395
LF: document preview of LF 1.11 (#8401)
CHANGELOG_BEGIN
* Release preview of LF 1.11. Preview versions can be changed only to
  include bug fixes. Changes of LF 1.11 include:
  - add support for generic map;
  - add support for choice observers;
  - reduce archive size thanks to type interning.
CHANGELOG_END
2021-01-06 13:47:59 +01:00
Remy
7c9331478b
LF: minro fixed suggested by Martin. (#8376)
from comments made in #8366.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-04 17:41:22 +01:00
Remy
8b5940842f
LF: fix specification of exceptions (#8366)
This is part of #8020.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-04 14:30:36 +01:00
Gary Verhaegen
a925f0174c
update copyright notices for 2021 (#8257)
* update copyright notices for 2021

To be merged on 2021-01-01.

CHANGELOG_BEGIN
CHANGELOG_END

* patch-bazel-windows & da-ghc-lib
2021-01-01 19:49:51 +01:00
Remy
9ba146a3e4
LF: Preview of LF 1.11 (#8280)
First step of LF 1.11 release #7139

Preview version is not stable and cannot be used in the ledger only in dev mode.

CHANGELOG_BEGIN
CHANGELOG_END
2020-12-18 17:08:22 +01:00
Remy
9bc2e4bd2c
LF: fix some of the choice-observer FIXMEs (#8281)
CHANGELOG_BEGIN
CHANGELOG_END
2020-12-14 18:26:49 +01:00
Remy
76c4380fef
LF: drop support from deprecated LF value versions. (#8083) (#8237)
* LF: drop support from deprecated LF value versions. (#8083)

CHANGELOG_BEGIN
CHANGELOG_END
2020-12-10 17:14:36 +01:00
Remy
45b04724ec
LF: Change ordering of builtin type to follow proto declaration (#8133)
CHANGELOG_BEGIN
CHANGELOG_END
2020-12-02 18:38:03 +01:00
Martin Huschenbett
fbabb5e0f4
DAML-LF spec: Incorporate Remy's feedback on exceptions (#8111)
CHANGELOG_BEGIN
CHANGELOG_END
2020-11-30 18:08:31 +01:00
Remy
17bed0fd3b
LF: clean spec from deprecated version (#8108)
* LF: clean the spec from deprecated versions

This advances the state of #7155.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-30 15:32:57 +01:00
Martin Huschenbett
da823c2c35
First batch of formal exception semantics (#8068)
* WIP Draft of formal exception semantics

CHANGELOG_BEGIN
CHANGELOG_END

* Make throw take an AnyException

* Don't allow templates as exceptions

* Make throw a builtin

* Pass the textual error message to to_any_exception

* Rename builtin exceptions to errors

* Rename to_any_exception in make_any_exception

* Fix typing rules for make/from_any_exception

* Add availability notes

* Fix typo
2020-11-27 16:12:32 +00:00
Martin Huschenbett
38a9c70a79
DAML-LF spec: Some minor fixes (#8050)
We correct some spelling mistakes and make the formatting of some rules a bit more consistent.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-24 15:07:54 +00:00
Remy
68c92b479c
LF: version transaction node independently in proto (#7925)
This advances the state of #7788.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-24 14:07:33 +01:00
Martin Huschenbett
da551ea142
DAML-LF spec: Explain how to use LaTeX input (#8018)
Add a description of how to enable LaTeX input mode when editing the
DAML-LF spec in VS Code. Also add some additional symbols.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-20 13:41:10 +01:00
Martin Huschenbett
cfb8681b1c
DAML-LF spec: Fix some bad markup for links (#8010)
CHANGELOG_BEGIN
CHANGELOG_END
2020-11-19 09:06:34 +00:00
nickchapman-da
6a745ed1fa
Support choice observers in 1.dev (#7922)
* Adapt to new desugaring for choice observers.

update hash of ghc patch.

changelog_begin
changelog_end

update ghc patch to final version

update stack-snapshot hashes for ghc-lib(-parser)

update stackage_snapshot.json, following `bazel run @stackage-unpinned//:pin`

expose Optional constructors for desugared code to use

adapt LFConversion to expect a 4-tuple for a desugared choice def/sig

update LFConversion for choice-observers

first example using new choice observer syntax.

fix scala type checker to have correct scoping rules for choice-observers

remove comment from example which says it is broken

improve variable names

improve tests for choice-observer clause

only test choice-observers SINCE 1.dev

add jq queries for choice observeres

make positive statement in jq test which checks choice obserers are present

test behaviour of choice observers

squash me

typo

* test more choice-observer divulgence

* Update documention for choice observers.

changelog_begin
Support choice observers in 1.dev
changelog_end

* fix docs build

* fix daml docs choice-observers example

* address comments: rewording text

* annotate choices observers as early-access in documention

* split out documentation code-snippets which require --target=1.dev

* final tweaks to documentation text
2020-11-18 19:51:15 +00:00
Sofia Faro
0057016519
Require pattern matching exhaustiveness in the LF spec. (#7946)
* Require pattern match exhaustiveness in spec.

Changes the rules for case expressions to require exhaustiveness.
This involves moving out the "well-formed case alternative" rules
to a separate judgement, and introducing a "pattern match
exhaustiveness" judgement.

The symbol ⊲ used for pattern match exhaustiveness comes from
sheaf theory and formal topology, where "A ⊲ B₁, …, Bₙ" means
"A is covered by { B₁, …, Bₙ }", indicating an exhaustive
coverage of A by possibly overlapping conditions B₁, …, Bₙ.
For example, see [this nlab page](https://ncatlab.org/nlab/show/posite).

It seemed appropriate.

changelog_begin
changelog_end

* rst syntax

* fix ExhaustVariant and some weird other syntax

* review comments
2020-11-12 11:47:55 +00:00
Remy
37eb1d4c4c
LF: Kill deprecated Transaction version. (#7785)
This PR drops support for Transaction version 1 to 9. This is a
breaking change that may affect only ledger created with a pre SDK
1.0.0. No Sandbox-based ledger is affected by this change.

This advances the state of #7788

This breaking change was approved by the architecture committed.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-04 15:45:42 +01:00
nickchapman-da
fd5db0cfd7
choice observers, prep (#7548)
* choice observers, WIP

changelog_begin
changelog_end

fix generator driven test

Node.isReplayedBy, consider observers

add observers to NodeExercise in transaction.proto

add observers to TemplateChoice in Ast.scala

add observers to LF .proto, and Haskell Ast for TemplateChoice

reinstate trailing // for better format

fix validate tests

fix haskell LF decoder when choice-observers field is missing in .proto

fix build

make choice-observers optional in scala AST

make choice-observers optional in Haskell Ast

address comments from Remy and Martin

more review comments

check TransactionVersions.minChoiceObservers in Transaction encode/decode

featureChoiceObservers, and check in haskell type-checker

improve speedy Compiler for empty choice-observers

extend scala LF decoder for optional choice observers

extend scala parser for choices to allow optional choice-observers clause, and test

rename new field in scala Ast -> "choiceObservers"

var rename

extend TypingSpec tests for choice-observers. also add missing negative test for controllers

switch from keyword "ob" to identifier "observers" in scala parser choice syntax

add TODO for featureChoiceObservers to be part of DAML 1.9 (issue 7139)

* replace "NICK" comment markers with "FIXME #7709" comment markers
2020-10-21 11:15:18 +01:00
Remy
27a4acafa4
LF: update DAML-LF specification with exercise_by_key. (#7702)
* LF: update DAML-LF specification with exercise_by_key.

CHANGELOG_BEGIN
CHANGELOG_END
2020-10-19 13:11:44 +02:00
Moritz Kiefer
e09c31899d
Connectify user-facing output (#7624)
Together with #7615, this overs all items in #7612.

changelog_begin
changelog_end
2020-10-09 15:45:02 +02:00
Remy
31f274ebca
LF: force actor field in Exercise Update to be undefined. (#7578)
* LF: force `actor` field in Exercise Update to be undefined.

This PR forces the field 'actor' from 'Upate.Exercise' to be undefined
starting from LF 1.5.

This breaking change is approved by Bernhard Elsner and Shaul Kfir.

It will affect only handcrafted LF archives, as no compiler from SDK
1.0.0 or latter made use of this field.

CHANGELOG_BEGIN
CHANGELOG_END
2020-10-07 14:42:10 +02:00
Remy
f67af49044
LF: typos in contract ID spec. (#7364)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-10 10:58:27 +02:00
Martin Huschenbett
cf3d5ad819
Contract ID spec: Fix typos (#7363)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-09 15:38:36 +00:00
Remy
73121fef0b
LF: minor typo in spec (#7352)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-09 11:39:32 +02:00
Martin Huschenbett
d7f0bc1c7b
DAML-LF spec: Fix two minor issues around structs (#7323)
* DAML-LF spec: Fix two minor issues around structs

We make it explicit that all field names in a structural record need to
be distince. We also fix a small typo in the indices for the
`ExpStructCon` typing rule.

CHANGELOG_BEGIN
CHANGELOG_END

* Address comments regarding distinctness

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-07 15:13:13 +02:00
Sofia Faro
3429ec24cc
Normalize struct field order in the LF spec. (#7228)
* Normalize struct field order in the LF spec.

This commit changes the LF spec to ensure that struct field order is ignored whenever reasonable.

* Rename "type synonym resolution" to "type normalization", and change the rule for structs to also normalize the order of fields.

* Make the struct type "well-formed" only if the struct fields are sorted by field name. (This matches the way "well-formed" is only used for normalized types. E.g. type synonyms are not considered "well-formed" by the spec. This nomenclature should possibly be fixed in a separate PR.)

* Change the struct con expression type rule accordingly.

* Change the definition of a struct value. A struct value is now a struct expression where all the field expressions are values, and all the field names are sorted.

* Change the evaluation rule for struct expressions to also sort the fields by field name in the process.

As far as I know, this spec matches the behavior of the LF engine. I also tried to make the treatment of struct field order in the types match the treatment of struct field order in expressions (i.e. normalized structs always have sorted fields, but non-normalized structs do not).

changelog_begin
changelog_end

* Apply suggestions from code review

Co-authored-by: Remy <remy.haemmerle@daml.com>

* Update daml-lf/spec/daml-lf-1.rst

Co-authored-by: Remy <remy.haemmerle@daml.com>
2020-08-25 14:32:03 +00:00
Moritz Kiefer
ab8b418b72
Add TO_TEXT_CONTRACT_ID primitive (#7137)
* Add TO_TEXT_CONTRACT_ID primitive

This is the first part of #7114.

This PR

* Adds the primitive to the protobuf.
* Handles decoding and encoding in Haskell and Scala.
* Handles typechecking in Haskell and Scala.
* Handles speedy compilation and interpretation in Scala.
* Updates the specification.

This PR does not yet change the standard library to make use of this
primitive.

changelog_begin
changelog_end

* Apply suggestions from code review

Co-authored-by: Remy <remy.haemmerle@daml.com>

* Avoid extra allocation

changelog_begin
changelog_end

Co-authored-by: Remy <remy.haemmerle@daml.com>
2020-08-17 08:39:16 +00:00
Remy
a39b7cc003
LF: check dependencies are not compiled to newer version. (#7050)
This PR prevents a module to depend on an older version of LF than the one is compile to.

CHANGELOG_BEGIN
CHANGELOG_END
2020-08-07 18:32:20 +02:00
Remy
5cae5b43ce
DAML-LF: fix minor typos in LF spec (#6963)
CHANGELOG_BEGIN
CHANGELOG_END
2020-08-03 15:07:57 +02:00
Sofia Faro
262220a501
Add 'unknown contract' cases in LF spec. (#6955)
* Add 'unknown contract' cases in LF spec.

changelog_begin
changelog_end

* Fix duplicate Err t

* remove indices
2020-08-03 12:54:57 +01:00
Sofia Faro
0f06d63570
Evaluation order specification and tests for exercise and other updates. (#6867)
* Evaluation order for exercise & other updates.

This adds more DAML tests and error cases for, finishing off the update
interpretation for now. I believe this is roughly the limit of what we
can test directly in DAML, and the rest is up to DAML-LF testing.

For example, there's no way to test that the contract inactivity check
in EvUpdExercInactive happens before the evaluation of the controller
expression, since there is no way to generate an 'exercise' with actors
from DAML, as far as I could tell, and 'exercise_without_actor' always
evaluates the controller before passing it off to 'exercise'.

For the same reason, the EvUpdExercBadActor check seems impossible to
trigger from DAML itself. The closest is an authorization test that
happens during submit (which I added a test for, because it is kinda
relevant to evaluation order of scenarios, even though scenario
interpretation isn't really important to the spec).

So at the very least we should add LF tests for those two cases.

changelog_begin
changelog_end

* Apply Moritz\'s suggestions

* Add test with fetch of consumed contract
2020-07-29 09:59:46 +01:00
Sofia Faro
8d5d9090c3
Draft of new operational semantics. (#6598)
* Draft of new operational semantics.

* make errors deterministic, and be explicit about them

* Flesh out the op semantics for expressions and add tests.

* Nail down the semantics of create

* Apply suggestions from code review

Co-authored-by: Remy <remy.haemmerle@daml.com>

* Add a reminder that u has to be a value

... in the update interpretation section.

changelog_begin
changelog_end

* add a test to track the ghc behavior on multi-lets

* add test for erasable type abstraction

* Add non-erasable type abstraction value test.

* move the ValExpTyAbsNat to 1.7-only value test

Co-authored-by: Remy <remy.haemmerle@daml.com>
2020-07-21 15:56:44 +00:00
Remy
969b0ff2c4
LF: typo in contract ID specification (#6316)
CHANGELOG_BEGIN
CHANGELOG_END
2020-06-12 11:00:57 +00:00
Remy
b4488b7099
LF: fix contract ID length in specification (#6303)
CHANGELOG_BEGIN
CHANGELOG_END
2020-06-11 10:27:29 +02:00
Remy
9e456a1016
DAML-LF: Kill RelativeContractId (#5991)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-25 22:30:45 +02:00
Martin Huschenbett
ce98261dbc
Fix a typo in the DAML-LF spec around contract keys (#5975)
In our first design draft, the maintainers of a contract key were
computed from the template payload. Now, they are computed from the
key itself. The rule `EvUpdCreateWithKeySucceed` still reflect the old
behavior but changing a single index from `t` to `v` fixes the issue.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-14 09:30:52 +00:00
Remy
710d10cbc8
Contract ID spec. Address Martin's comments Martin #5784 (#5876)
* Contract ID spec. Address Martin's comments Martin #5784

* changelog

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-07 08:27:35 +00:00
Remy
5d5fddbc0a
DAML-LF: Contract ID allocation scheme specification (#5784)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-06 18:07:41 +02:00
Martin Huschenbett
bea3f76750
Remove spurious first argument from SHIFT_NUMERIC in DAML-LF spec (#5812)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-01 23:24:22 +00:00
Martin Huschenbett
b6299834e0
Fix the DAML-LF spec regarding text/codepoints conversion (#5818)
The two functions to convert between text and a list of codepoints
were documented the wrong way around. This PR fixes the issue. We
also sprinkle in a few plural "s" where needed.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-01 22:08:56 +00:00
Remy
9690ba123c
DAML-LF: update spec with scenarios (#5344)
CHANGELOG_BEGIN
CHANGELOG_END
2020-04-20 17:12:08 +02:00
Remy
50694c7abe
DAML-LF. fix parameter and self binder in choices. (#5444)
* DAML-LF. fix parameter and self binder in choices.

* fix

* DAML-LF: address moritz's comments

* changelog

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-06 14:32:30 +00:00
Gerolf Seitz
a2d785e3ee
Use com.daml as root package (#5343)
Packages com.digitalasset.daml and com.daml have been unified under com.daml

Ledger API and DAML-LF DEV protos have also been moved from `com/digitalasset`
to `com/daml` on the file system.
Protos for already released DAML LF versions (1.6, 1.7, 1.8) stay in the
package `com.digitalasset`.

CHANGELOG_BEGIN
[SDK] All Java and Scala packages starting with
``com.digitalasset.daml`` and ``com.digitalasset`` are now consolidated
under ``com.daml``. Simply changing imports should be enough to
migrate your code.
CHANGELOG_END
2020-04-05 19:49:57 +02:00
Remy
fa21bd3f24
DAML-LF: deprecate all DAML-LF < 1.6 (#5321)
CHANGELOG_BEGIN
* [DAML-LF] *Breaking* deprecating all DAML-LF versions < 1.6
   - older versions will be maintained and supported for Sandbox classic.
   - no data continuity would be guaranteed any-more for other ledgers using DAML-LF < 1.6
CHANGELOG_END
2020-03-31 21:28:28 +02:00
Remy
20218e4175
DAML-LF: restrict length of parties (#5237)
CHANGELOG_BEGIN
* [DAML-LF]. *Breaking* Restrict length of parties
CHANGELOG_END
2020-03-27 14:52:43 +01:00
Gary Verhaegen
1872c668a5
replace DAML Authors with DA in copyright headers (#5228)
Change requested by Manoj.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 01:26:10 +01:00
Ognjen Maric
f7aa2a3db0
Add keys with maintainers to Fetch nodes (#5186)
Add keys with maintainers to Fetch nodes

The new field is populated by the interpreter whenever the fetched
contract has a key. Used for contract key reinterpretation in Canton.

CHANGELOG_BEGIN

- [DAML-LF] Add keys with maintainers to Fetch nodes in transactions.

CHANGELOG_END
2020-03-26 14:07:17 +01:00
Remy
2dd9c50631
DAML-LF: contract id spec (#5106)
* DAML-LF: contract id spec

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-23 18:05:48 +01:00
Remy
1c26f63fad
DAML-LF: GenMap Spec (#4981)
* DAML-LF: GenMap Spec

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-16 13:09:44 +01:00
Remy
65e988b778
[DAML-LF] specification for generic comparison. (#4942)
* [DAML-LF] specification for generic comparison.

+ update generic equality

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-12 22:07:13 +01:00
Moritz Kiefer
d68d3eb74a
Freeze DAML-LF 1.8 (#4770)
* Freeze DAML-LF 1.8

Two minor points that I did not mention in the previous PR:

We also include the renaming of structural records to `struct` and the
renaming of `Map` to `TextMap`.

There are some minor changes around the LF encoder tests which need to
be able to emit package metadata properly so I’ve added it to the
parser. Sorry for not splitting that out.

Following the process used for the DAML-LF 1.7 release, this does not
yet include the frozen proto file.

changelog_begin

- [DAML-LF] Release DAML-LF 1.8:

  * Rename structural records to ``Struct``. Note that
    structural records are not exposed in DAML.
  * Rename ``Map`` to ``TextMap``.
  * Add type synonyms. Note that type synonyms are not serializable.
  * Add package metadata, i.e., package names and versions.

  Note that the default output of ``damlc`` is stil DAML-LF 1.7. You
  can produce DAML-LF 1.8 by passing ``--target=1.8``.

changelog_end

* Update encoder

* Update java codegen tests

* Update comment in scala codegen

* Handle TSynApp in interface reader

* Bump lf_stable_version to 1.7

* Fix kvutils tests
2020-03-02 18:29:26 +01:00
Moritz Kiefer
040d343b8c
Document package metadata in LF spec (#4764)
* Document package metadata in LF spec

changelog_begin
changelog_end

* remove space
2020-03-02 11:32:36 +00:00
associahedron
04e8b4b7b1
First pass at generic order relation in DAML-LF 1.dev spec. (#4116)
* Generic order relation, first pass

* First pass at generic order specification

changelog_begin
changelog_end

* Order functions raise an error if the arguments are incomparable

* refer to internal representation for cid ordering

* Add gen lt rules for maps.
2020-01-23 14:05:05 +00:00
Remy
63d6e73f4c Engine: Simplify ordering of nodes in transaction (#4140)
* engine: the natural order in Transaction is pre-order traversal

- Do not use anymore SortedMap for nodes in transaction
- Drop unused transaction traversal

CHANGELOG_BEGIN
CHANGELOG_END

* daml-lg: improve generator of transactions
2020-01-22 15:53:44 +00:00
Remy
4cc14275d5 engine: node are ordered in transactions (#4129)
* engine: node in children are ordered

CHANGELOG_BEGIN
CHANGELOG_END

* address Gerolf's comment
2020-01-21 14:39:35 +00:00
Ognjen Maric
589f710313
Prohibit contract IDs in contract keys and add key maintainers to exercises (#4048)
Prohibit contract IDs in contract keys and add key maintainers to exercises

CHANGELOG_BEGIN

- [DAML-LF] Prohibit contract IDs in contract keys completely. Previously, creating keys containing absolute (but not relative) contract IDs was allowed, but `lookupByKey` on such a key would crash. 

CHANGELOG_END

Co-authored-by: Remy <remy.haemmerle@daml.com>
Co-authored-by: Stephen Compall <scompall@nocandysw.com>
2020-01-20 16:36:38 +01:00
Gary Verhaegen
878429e3bf
update copyright notices to 2020 (#3939)
copyright update 2020

* update template
* run script: `dade-copyright-headers update .`
* update script
* manual adjustments
* exclude frozen proto files from further header checks (by adding NO_AUTO_COPYRIGHT files)
2020-01-02 21:21:13 +01:00
Remy
9dadfc05bc daml-lf: second version of type synonym spec (#3782)
* daml-lf: second version of type synonym spec

* cosmetic changes

* more fixes

* make special application for type synonymes

* Update daml-lf/spec/daml-lf-1.rst

Co-Authored-By: associahedron <231829+associahedron@users.noreply.github.com>

* make type synonym different from type constructor

* typos
2019-12-12 17:28:18 +00:00
Remy
a893202c32 DAML-LF: decommission equality function for atomic values (#3817) 2019-12-11 13:08:47 +00:00
Remy
21630a8841 DAML-LF: fix generic equality (#3812)
* DAML-LF: generic equality is available in dev only

* more doc fixes

* please restart CI
2019-12-11 11:02:24 +00:00
Remy
a309b4a50b
DAML-LF: spec cleanup (#3801) 2019-12-10 13:38:55 +01:00
Remy
96b3e33c27 daml-lf: specified generic equality (#3740)
* daml-lf: specified generic equality

* polishing

* address reviews

* more polishing

* address Samir's comments
2019-12-05 15:47:49 +00:00
Moritz Kiefer
f5605247b3
Include type synonyms in LF abstract syntax (#3694)
* Include type synonyms in LF abstract syntax

* Use T instead of S for synonyms

Following a suggestion from @remyhaemmerle-da, we avoid having to
adapt all rules to synonyms by simply reusing the definition of type
constructors.
2019-12-02 15:20:38 +01:00
nickchapman-da
885bbefdf3 rename structural records: tuple -> struct (#3660)
* rename structural records: tuple -> struct

* add missing renames (tuple -> struct) in comments, var-names and error messages

* exposition: structural vs nominal; change history note

* remove accidentilly checked-in file
2019-11-28 10:00:24 +00:00
Remy
997e206779 daml-lf: type synonyms are also taken into account for collisions (#3644) 2019-11-27 08:36:59 +00:00
Moritz Kiefer
41958b1430 Fix typo in synonym spec (#3636) 2019-11-26 17:15:58 +01:00
Moritz Kiefer
f402acf19b Add specification for type synonyms in DAML-LF (#3635)
* Add specification for type synonyms in DAML-LF

* Fix identifiers for type synonyms

* Use S for type synonyms

* Address review comments

* Split up TyTypeSynonym and DefTypeSynonym
2019-11-26 15:01:44 +00:00
Remy
06b7a106a1 DAML-LF: generic map values protobuf format (#3583)
* DAML-LF: generic map values protobuf format

* Apply suggestions from code review

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

* Address Gerolf's comment

* Apply suggestions from code review

Co-Authored-By: Stephen Compall <stephen.compall@daml.com>

* fix test

* Address Stephen's last comment
2019-11-26 13:34:33 +00:00
Remy
d152c7cbfd daml-lf: rename Map to TextMap in archive proto (#3589)
* daml-lf: rename Map to TextMap in archive proto
+ in Scala/haskell AST

* a bit more renamming

* Update compiler/daml-lf-tools/src/DA/Daml/LF/TypeChecker/Serializability.hs

Co-Authored-By: associahedron <231829+associahedron@users.noreply.github.com>

* fix test

* Apply suggestions from code review

Co-Authored-By: associahedron <231829+associahedron@users.noreply.github.com>

* Update compiler/daml-lf-ast/src/DA/Daml/LF/Ast/Base.hs

Co-Authored-By: associahedron <231829+associahedron@users.noreply.github.com>
2019-11-25 12:14:57 +00:00
associahedron
cacd12f511
Add GenMap to DAML-LF 1.dev spec (#3260)
* Add GenMap to DAML-LF 1.dev

* Update LF spec

* remove type constraints again

* Revert "remove type constraints again"

This reverts commit 2081e5b8ef.

* Fix a messed up merge
2019-11-11 16:36:09 +00:00
Remy
d39d7974fc daml-lf: freeze version 1.7 (#3340)
* daml-lf: freeze daml-lf 1.7

* speedy: remove useless double checks
2019-11-07 09:51:18 +00:00
Remy
7c427119e1 DAML-LF add Type Representation value (#3326)
* daml-lf: update spec with type-rep

* daml-lf: update proto with type-rep

* daml-lf: update scala side with TypeRep

* daml-lf: update compiler side with TypeRep

* Get triggers to compile

* Add featureTypeRep to allFeatures

* Apply suggestions from code review

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* daml-lf: add builtin for TypeRep equality

* Address Andrea's comments

* formatting

* Fix triggers

* Fix template typerep tests
2019-11-04 17:00:55 +00:00
Remy
d56a4aa715 Intern all strings: proto cleanup (#3296)
* daml-lf: cleanup strings/names interning for 1.dev

* change level of dottedName intening
* make interning mandatory
* rational name of proto field

* fix tests

* spec update

* fix test

* formatting

* Address Gerolf's comments

* Address Jussi's comments
2019-11-01 17:03:42 +00:00
Remy
5812a1246d
daml-lf: to_text_template_id -> to_text_type_con_name (#3293)
* simplify to_text_template_id

* to_text_template_id -> to_text_type_con_name
2019-10-30 17:32:36 +01:00
Remy
b66c231aa0 daml-lf-spec: remove improper changes from a3518d67 (#3277)
* daml-lf-spec: remove improper changes from a3518d67

* address Gerolf's comments
2019-10-29 13:36:58 +00:00
Moritz Kiefer
f4766ad903 Forbid quantifiers in Any in the Haskell typechecker (#3200)
This is a followup to #3196 which updated the Scala typechecker
2019-10-16 15:10:45 +00:00
Remy
b2985c394f daml-lf: prevent use of quanitifier in any type (#3196) 2019-10-16 11:41:58 +00:00
Remy
a3518d671e daml-lf proto: archive proto for daml-lf 1.6 (#3142)
* daml-lf proto: archive proto for daml-lf 1.6

* try to fix archive ProtoTest for windows

* more windows fix for  archive ProtoTest
2019-10-15 18:35:20 +00:00