Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supercharge traces #978

Merged
merged 10 commits into from
Jul 23, 2024
Merged

Supercharge traces #978

merged 10 commits into from
Jul 23, 2024

Commits on Jul 18, 2024

  1. Allow variadic arguments in trace

      Although, doesn't do anything with them yet. The idea is to simplify
      the use of trace to make it a lot more useful than it currently is.
    KtorZ committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    f9719af View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    754ed07 View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2024

  1. Add 'diagnostic' to the prelude, as well as companion functions.

      This is not fully satisfactory as it pollutes a bit the prelude. Ideally, those functions should only be visible
      and usable by the underlying trace code. But for now, we'll just go with it.
    KtorZ committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    beb5ac4 View commit details
    Browse the repository at this point in the history
  2. Allow serialisable (Data-able) arguments to trace

      Somehow, we have to patch some function in gen_uplc because of the
      module name. I have to look further into this because it isn't normal.
    KtorZ committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    f823681 View commit details
    Browse the repository at this point in the history
  3. Remove unnecessary code_gen patch.

      This is a little weird but, prelude functions are handled slightly
      differently.
    KtorZ committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    5afcc9b View commit details
    Browse the repository at this point in the history
  4. re-introduce code-gen patch, but with a test.

      Actually, this has been a bug for a long time it seems. Calling any
      prelude functions using a qualified import would result in a codegen
      crash. Whoopsie.
    
      This is now fixed as shown by the regression test.
    KtorZ committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    a9d782e View commit details
    Browse the repository at this point in the history
  5. Rework 'compact' mode for traces

      - Trace-if-false are now completely discarded in compact mode.
    
      - Only the label (i.e. first trace argument) is preserved.
    
      - When compiling with tracing _compact_, the first label MUST unify to
        a string. This shouldn't be an issue generally speaking and would
        enforce that traces follow the pattern
    
        ```
        label: arg_0[, arg_1, ..., arg_n]
        ```
    
      Note that what isn't obvious with these changes is that we now support
      what the "emit" keyword was trying to achieve; as we compile now with
      user-defined traces only, and in compact mode to only keep event
      labels in the final contract; while allowing larger payloads with
      verbose tracing.
    KtorZ committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    d6fd37c View commit details
    Browse the repository at this point in the history
  6. Display expected patterns/tokens in parse error when applicable.

      We've never been using those 'expected' tokens captured during
      parsing, which is lame because they contain useful information!
    
      This is much better than merely showing our infamous
    
        "Try removing it!"
    KtorZ committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    2922c0a View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    30ddfa2 View commit details
    Browse the repository at this point in the history
  8. Fill-in CHANGELOG

    KtorZ committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    89890f3 View commit details
    Browse the repository at this point in the history