Commit Graph

251 Commits

Author SHA1 Message Date
microproofs e4e8ca8a6d
Update changelog 2024-10-01 16:13:33 -04:00
KtorZ 513ca27717
Generate empty redeemer for `else` handler, to keep full compliance with the blueprint spec 2024-10-01 19:03:34 +02:00
KtorZ e8d97028ad
Prevent constant evaluating to generic/unbound functions
Constants are like tiny programs, so they are bound by the same rules
  as validators and other programs. In fact, functions are slightly more
  flexible in that they allow generic constant expressions like
  `List<a>`.

  Yet, there is no way to contain such generic structure that contain
  inhabitants in a way that satisfies the type-checker. In the example
  of `List<a>`, the only inhabitant of that type that we can construct
  is the empty list. Anything else would require holding onto some
  generic value.

  In addition, we can't force literal values into generic annotation, as
  something like:

  ```
  const foo: List<a> = [1, 2, 3]
  ```

  wouldn't type-check either since the right-side would unify to
  `List<Int>`. And again, the only right-hand side that can type-check
  is the empty list without any inhabitant.

  The added restriction on generic function is necessary because while
  we allow constants to return lambda, we cannot (easily) generate UPLC
  that is generic in its argument. By the time we generate UPLC, the
  underlying types have to be known.
2024-10-01 18:37:40 +02:00
KtorZ 51b6b77db8
Build LSP projects with verbose tracing level
Without that, the language server might trigger awkward warnings about
  unused imports due to trace stripping. So it's better to compile/check
  projects in the language server in the most expanded form.
2024-10-01 16:12:41 +02:00
KtorZ 0060804d1a
Fix redundant warning when destructuring validator params
This is not a "proper" fix as it simply get rid of the warning
  altogether (whether you use or not the destructured values).

  The reason for removing the warning entirely is because (1) it's
  simpler, but more so (2) there's no impact on the final code produced
  _anyway_. Redundant let bindings are already removed by the compiler;
  and while it's an implicit behaviour that requires a proper warning
  when it's coming from a user-defined assignment; here the redundant
  assignment is introduced by the compiler to begin with as another
  implicit behavior!

  So we have an implicit behaviour triggering a warning on another
  implicit behaviour. Truth is, there's no impact in having those
  parameters destructured and unused. So since users are already not
  aware that this results in an implicit let assignment being inserted
  in place for them; there's no need for the warning at all.
2024-10-01 13:17:00 +02:00
KtorZ 5737556efc
Fix compiler crash around dangling expect/let in traces
Fixes #1029.
2024-10-01 12:24:31 +02:00
KtorZ 9533903acc
Prepare CHANGELOG for v1.1.4 2024-10-01 11:20:07 +02:00
microproofs d3e95bd000
Changelog release change 2024-09-20 13:49:45 -04:00
microproofs c3af748b76
Update changelog 2024-09-20 12:53:34 -04:00
KtorZ a8b37820e8
Fix incorrect warning about unused variable when softcasting without explicit right-pattern.
See note added in code for a rationale.
2024-09-20 15:09:00 +02:00
KtorZ 83ac723a50
Fix extraneous space added after multiline alternative patterns 2024-09-19 20:24:59 +02:00
KtorZ dd77fa7e53
Mention cost model fixes in CHANGELOG. 2024-09-19 20:20:30 +02:00
KtorZ 3f149ab346
Provide intermediate feedback during property test runs.
Avoid the interface to hang for several seconds without feedback when counterexamples are being simplified. This sends a heads-up to the user to indicate that a research of a counter example is going on.
2024-09-19 20:19:49 +02:00
KtorZ 47a15cf8b2
Fix formatting of long multiline if/is expressions. 2024-09-15 14:59:47 +02:00
KtorZ 12c0d0bc04
Fix formatter adding extra unnecessary newlines after literal lists clause values or assignments. 2024-09-15 14:40:40 +02:00
KtorZ d6c728c0f6
Fix link_tree generation when re-inserting the same modules. 2024-09-14 16:30:28 +02:00
microproofs 0f8cb19ede
Update Changelog for release 2024-09-13 16:49:37 -04:00
KtorZ a9a7a4f977
Fix few formatter annoyances. 2024-09-13 18:53:26 +02:00
KtorZ 4fb13af49f
Fix type reification of PRNG. 2024-09-13 18:34:53 +02:00
microproofs debbae4fda
Update Changelog 2024-09-13 12:09:11 -04:00
KtorZ 74d197077d
Mention Riley contribution in CHANGELOG. 2024-09-10 13:23:16 +02:00
KtorZ 7741be64f8
Fix validator's fallback handler generation
Fixes #1015.
2024-09-10 10:48:06 +02:00
KtorZ 616dec8f03
Fix formatter getting rid of curly braces around multi-line constants. 2024-09-08 16:23:41 +02:00
KtorZ 0c0369ad61
Fix needed parentheses under trace-if-false disappearing when formatting. 2024-09-08 16:21:45 +02:00
KtorZ b6d99142f9
Fix formatting of multi-line alternative patterns. 2024-09-08 13:11:53 +02:00
KtorZ b7ea6ea391
Fix list-pattern formatting 2024-09-07 14:50:47 +02:00
KtorZ 19e30b10f9
Fix #1013 2024-09-06 12:28:12 +02:00
Matthias Benkort 1f692bc93e
Update CHANGELOG.md 2024-09-03 23:30:18 +02:00
KtorZ f60df16bc2
Preserve type-aliases during blueprint generation. 2024-09-03 16:39:50 +02:00
KtorZ 5414fd8f04
Fill-in CHANGELOG for zero-arg / super-const. 2024-08-30 18:41:06 +02:00
KtorZ 70e760cbaa
Fill-in CHANGELOG regarding last expect and tests now accepting Void. 2024-08-23 16:04:40 +02:00
KtorZ d1ee90a3a0
Update CHANGELOG.md 2024-08-23 10:41:20 +02:00
KtorZ 39c1b5a68a
Merge branch 'generated-docs-improvements' 2024-08-22 16:41:54 +02:00
Matthias Benkort 2bb2f11090
Update CHANGELOG.md 2024-08-14 10:03:42 +02:00
KtorZ 9d8fdf787c
Improve formatter on long-lines, in particular bin-ops. 2024-08-06 19:25:35 +02:00
KtorZ e3b1cf1093
Rework CHANGELOG to reflect reality.
We never released 1.0.30, so it's a bit misleading to have an entry for it in the CHANGELOG. So I merged its content with the ongoing release which is likely to be 1.1.0
2024-08-06 10:50:15 +02:00
KtorZ a07f8cbc58
Fill-in CHANGELOG. 2024-08-04 14:48:03 +02:00
KtorZ f14dfdf8e1
Allow pattern-matching on bytearrays
- Doesn't allow pattern-matching on G1/G2 elements and strings,
    because the use cases for those is unclear and it adds complexity to
    the feature.

  - We still _parse_ patterns on G1/G2 elements and strings, but emit an
    error in those cases.

  - The syntax is the same as for bytearray literals (i.e. supports hex,
    utf-8 strings or plain arrays of bytes).
2024-08-03 13:51:36 +02:00
KtorZ ea032c90f2
Add missing CHANGELOG entries. 2024-08-02 12:08:25 +02:00
KtorZ bf5a406ffb Remove clause guards.
Closes #886.
2024-08-02 00:16:27 -04:00
KtorZ b28d4a6e9f
Add input reference to ReferenceInputNotFound error.
Fixes #974.
2024-08-01 15:29:39 +02:00
KtorZ 91aa435f37
Fix 'multiline' truncating last character of each line.
Fixes #987.
2024-08-01 15:20:43 +02:00
KtorZ 327449e320
Update CHANGELOG, bump date, document latest fixes & optimizations 2024-07-25 09:54:03 +02:00
KtorZ 987a5fa779
Set a date for v1.0.30-alpha release. 2024-07-24 09:39:48 +02:00
rvcas 06ac851458
chore: update changelog 2024-07-23 11:20:42 -04:00
KtorZ 89890f3b4b
Fill-in CHANGELOG 2024-07-19 12:44:12 +02:00
KtorZ 976262c2e6
Allow discard in expect.
Fixes #967.
2024-07-17 18:11:09 +02:00
KtorZ 858dfccc82
Authorize complete patterns as function args.
This is mainly a syntactic trick/sugar, but it's been pretty annoying
  to me for a while that we can't simply pattern-match/destructure
  single-variant constructors directly from the args list. A classic
  example is when writing property tests:

  ```ak
  test foo(params via both(bytearray(), int())) {
    let (bytes, ix) = params
    ...
  }
  ```

  Now can be replaced simply with:

  ```
  test foo((bytes, ix) via both(bytearray(), int())) {
    ...
  }
  ```

  If feels natural, especially coming from the JavaScript, Haskell or
  Rust worlds and is mostly convenient. Behind the scene, the compiler
  does nothing more than re-writing the AST as the first form, with
  pre-generated arg names. Then, we fully rely on the existing
  type-checking capabilities and thus, works in a seamless way as if we
  were just pattern matching inline.
2024-06-07 15:42:25 +02:00
KtorZ 257bd23019
update changelog 2024-06-06 11:21:17 +02:00
KtorZ 87f4ed359b
Update changelog: set a release date. 2024-06-06 11:19:33 +02:00