Commit Graph

139 Commits

Author SHA1 Message Date
Moisés Ackerman
f59d1cd0b4
Convert experimental primitive TYPEREP_TYCON_NAME into proper LF builtin (#13465)
* Convert experimental primitive TYPEREP_TYCON_NAME into proper LF builtin

* Add entry for TYPEREP_TYCON_NAME in daml-lf spec

* disable quickcheck test in DA.Test.Packaging

changelog_begin
changelog_end
2022-03-31 14:35:46 +02:00
Sofia Faro
8582b04861
ifaces: Add semantics for 'exercise_interface' in the LF spec (#13404)
* ifaces: Add exercise interface semantics to spec

This is based on the semantics of 'exercise'.

Closes #11349 (for now). Also fixes a small bug in the semantics of 'exercise'.

changelog_begin
changelog_end

* Uniformize exercise syntax
2022-03-25 11:37:43 +00:00
Sofia Faro
3646ec2358
interfaces: Add unsafe conversion to LF spec (#13399)
changelog_begin
changelog_end
2022-03-24 15:22:39 +00:00
Sofia Faro
85c4ea0b5c
LF spce: Make controller/observer errors fatal (#13192)
changelog_begin
changelog_end
2022-03-08 12:32:10 +00:00
Sofia Faro
190fd2487c
LF: Add interface preconditions to spec (#13173)
* LF: Add interface preconditions to spec.

Part of #11349

changelog_begin
changelog_end

* two should be True

* Incorporate remy suggestion
2022-03-08 10:11:54 +00:00
Sofia Faro
b2d6f8014c
LF: Use template parameter (this) in method bodies. (#13142)
* Use `this` param in method bodies in LF.

Instead of having method bodies be functions from the template, have them reuse the existing template parameter (usually `this`).

Fixes #13123

changelog_begin
changelog_end

* fix validation-test
2022-03-03 13:50:59 +00:00
Sofia Faro
8075a64f7f
LF Spec: Add interface expressions (#13103)
* LF Spec: Add interface expressions

This PR adds type rules and operational semantics for interface
expressions (including updates). The only thing I haven't added yet is
the operational semantics for exercise interface, and the operational
semantics for interface preconditions.

changelog_begin
changelog_end

* typo

* spurious duplicate

* minor edits

* review suggestions
2022-03-02 11:20:07 +00:00
Sofia Faro
0e03e2f100
Add interfaces to LF spec (#13020)
* Add interfaces to LF spec.

Part of #11349. This PR adds the interface & implements declarations, deals with "requires", and name collisions. I'm leaving expression types and operational semantics to a future PR.

changelog_begin
changelog_end

* missing curly

* change T to I for interfaces

* revisions from Remy
2022-02-24 17:09:20 +00:00
Gary Verhaegen
d2e2c21684
update copyright headers (#12240)
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.

I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-03 16:36:51 +00:00
Andreas Lochbihler
3cd5028b61
fix a few more things in the daml-lf spec (#11851)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Remy Haemmerle <Remy.Haemmerle@daml.com>
2021-11-25 10:46:19 +01:00
Moritz Kiefer
f801314c16
Drop exercise with actor from LF spec (#11721)
This doesn’t exist since LF 1.5 and we don’t support that or any LF
version before anymore.

changelog_begin
changelog_end
2021-11-16 18:31:36 +01:00
Andreas Lochbihler
18433eb19e
fix arity of TArrow type constructor in Daml-LF spec (#11677)
CHANGELOG_BEGIN
CHANGELOG_END
2021-11-15 07:49:45 +01:00
Andreas Lochbihler
d4336510af
fix a few typos in Daml-LF spec (#11583)
CHANGELOG_BEGIN
CHANGELOG_END
2021-11-09 08:36:28 +01:00
Remy
9ef3377864
LF: Update specification with Contract ID Comparability check (#10703)
This is part of #10504.

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-31 13:01:25 +02:00
Remy
4ae4a9daf7
LF: restrict length of Name and DottedName (#10453)
fixes #10358

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-02 15:49:03 +02:00
Remy
ee755306fe
LF: Specify nesting constraint for serialized values. (#10375)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-22 17:50:29 +02:00
Moritz Kiefer
66284c17f2
Limit length of package ids to 64 characters (#10368)
* Limit length of package ids to 64 characters

In practice, you cannot use a package id that is not a valid sha256
outside of a test anyway since we validate them. However, we didn’t
enforce it at the daml-lf level which is a bit annoying.

This PR fixes this and adds a length restriction of 64
characters (i.e. 256 bytes for sha256).

We could go a bit further and also restrict the characters to valid
sha256 hashes (i.e. 64 character hex strings). I don’t feel all that
strongly about that either way. We use other characters in tests but
fixing that shouldn’t be particularly hard either. The extra
characters don’t seem to cause problem so far, so I think it’s fine to
keep that.

No changelog entry since I don’t see how a user can be affected by this.

changelog_begin
changelog_end

* Update daml-lf/encoder/src/main/scala/com/digitalasset/daml/lf/archive/testing/DamlLfEncoder.scala
2021-07-22 10:50:11 +00:00
Remy
f033bc2bbb
LF: Clean legacy from archive proto + TEXT_TO_CODE_POINTS typo (#10286)
Thanks to @tristan-da for pointing this out.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-15 16:01:08 +02:00
Remy
f745f10394
LF: Realease LF 1.14 (#10077)
CHANGELOG_BEGIN
- [LF] Add support for Excepction
CHANGELOG_END
2021-06-24 13:44:09 +02:00
Sofia Faro
0c32cf2968
Clarify the semantics of DIV_INT64 in LF spec. (#10003)
* Clarify semantics of DIV_INT64 in LF spec.

Especially around negative operands. Adds a couple of unit tests to make sure the behavior stays this way, and that MOD_INT64 is consistent with DIV_INT64.

changelog_begin
changelog_end

* spelling

* scalafmt

* hardcode numbers in MOD_INT64 test
2021-06-15 10:22:13 +00:00
Remy
5e1ddfbd5e
LF: Fix specification of ArithmeticError (#9949)
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-10 13:37:16 +02:00
Remy
512f1fd87d
LF: Preview version of LF 1.14 (#9906)
+ Preview support for Exceptions.
+ byKey flag for transaction nodes.

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-03 20:40:53 +02:00
Sofia Faro
41266c35e2
Fix the formatting on the LF spec. (#9889)
changelog_begin
changelog_end
2021-06-03 09:51:50 +01:00
Sofia Faro
4e9c86ccd0
Fix a typo in LF spec normalization section. (#9797)
changelog_begin
changelog_end
2021-05-26 08:19:45 +01:00
Sofia Faro
d024efeffc
Add a section on transaction normalization in the LF spec. (#9788)
Note that it only has rules for normalizing `create` and `exercise`, but that's because the LF spec only has `create` and `exercise` actions for now.

changelog_begin
changelog_end
2021-05-26 07:45:54 +01:00
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
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
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
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
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
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