1
1
mirror of https://github.com/anoma/juvix.git synced 2024-11-29 21:32:43 +03:00
Commit Graph

1604 Commits

Author SHA1 Message Date
Jan Mas Rovira
3285b4cb69 change order of Bool constructors 2024-11-22 11:05:24 +01:00
Jan Mas Rovira
379c2ec11f update stdlib 2024-11-22 10:12:17 +01:00
Jan Mas Rovira
4229a3f215 update stdlib 2024-11-21 19:52:23 +01:00
Jan Mas Rovira
7688c22e6d decrease clause number 2024-11-21 19:42:00 +01:00
Jan Mas Rovira
4ef477cb34 improve 2024-11-21 19:28:53 +01:00
Jan Mas Rovira
9c7eecb03c fixes 2024-11-21 19:23:08 +01:00
Jan Mas Rovira
c74a6757c5 derive ord 2024-11-21 19:23:08 +01:00
Jan Mas Rovira
a13acc9721 wip 2024-11-21 19:23:08 +01:00
Jan Mas Rovira
d38c1cac36 add positive test 2024-11-21 19:22:43 +01:00
Jan Mas Rovira
26759be196 remove debug comment 2024-11-21 19:22:43 +01:00
Jan Mas Rovira
7e92fda8bf use checkTypeSig 2024-11-21 19:22:42 +01:00
Jan Mas Rovira
a95b8d2f6e lookupInfo order 2024-11-21 17:35:03 +01:00
Jan Mas Rovira
87aebc9226 lookupInfo naming convention 2024-11-21 17:32:49 +01:00
Jan Mas Rovira
99af0ac732 refactor 2024-11-20 18:48:53 +01:00
Jan Mas Rovira
2e14594c6b negative test 2024-11-20 18:34:04 +01:00
Jan Mas Rovira
e83d265795 fix rebase 2024-11-20 18:34:04 +01:00
Jan Mas Rovira
84ad0040a2 Squashed commit of the following:
commit 267b34a3f5a728769fa567421eda1ede5107428c
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Wed Nov 20 14:18:11 2024 +0100

    give proper name of builtins

commit d0dc4155db5fa81945df343faeaf023e7850f094
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Wed Nov 20 14:09:37 2024 +0100

    better error message

commit ccd90448c514ff1a8e9f00b8dd714b660afc0183
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Wed Nov 20 11:27:05 2024 +0100

    allow implicit args

commit 768f45d5d04505307534ed0e54d109e27ea34e48
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Tue Nov 19 18:44:50 2024 +0100

    stdlib

commit e778aaf9a427e8af1cec89f5d164cdec9d0984aa
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Tue Nov 19 18:29:00 2024 +0100

    clean

commit 17939c76ea4f034c2840463f24dfd8c7a5325645
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Tue Nov 19 18:27:22 2024 +0100

    update stdlib

commit 46d73889ae26f8c0d0b34c666ef1b35ad2af859e
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Tue Nov 19 18:18:22 2024 +0100

    pragmas

commit 58d1063b4e4d683f6b6bd314e444d65f30534fd3
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Tue Nov 19 18:09:23 2024 +0100

    do not group deriving statements

commit 057fdbbeef54683d4c16116bb00e097c00496203
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Tue Nov 19 15:14:31 2024 +0100

    default case

commit d280fe741c34eaf60543d6cc4c311470d12ead0b
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Tue Nov 19 14:55:36 2024 +0100

    fix

commit e3a7a764872d2c95ebcfbc1a0c5f3b4848c0b0da
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Tue Nov 19 09:57:22 2024 +0100

    from concrete

commit f8fd9f484737749d26d63e41fa6759a82d50fb23
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Mon Nov 18 18:45:20 2024 +0100

    refactor Fail

commit a889cb65ffa7c62572aa286ac7b669f28d57d5d8
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Mon Nov 18 18:00:27 2024 +0100

    wip

commit 734f7c192d84e1e637175826b520d994e2f38ec6
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Mon Nov 18 13:00:14 2024 +0100

    wip

commit 6a2d7d2c994c315e9af86071c94a0f4be33cbeef
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Fri Nov 15 13:29:44 2024 +0100

    parsing and printing deriving kw

commit 412a6545ba3b00a9226103f2a828d7b96e6fe164
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Fri Nov 15 12:52:11 2024 +0100

    add deriving kw

commit 110146284952ab8d985ca86875c4594eef9375ca
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Fri Nov 15 12:51:18 2024 +0100

    style

commit 3aeec441865484fef18e9956b3579215cddc7c60
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Thu Nov 14 17:39:09 2024 +0100

    remove section titles from parser

commit 15ec17dd6d8c1f4f421df51d520a1e26f48cc05c
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Thu Nov 14 15:29:57 2024 +0100

    update stdlib

commit 546b5b2f7a6f2a2d4579406f7f672a5a02a19a42
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date:   Thu Nov 14 11:27:04 2024 +0100

    make Eq builtin

commit 865842046d
Author: Paul Cadman <git@paulcadman.dev>
Date:   Wed Nov 20 07:53:21 2024 +0000

    Support running nockma code with a running Anoma client (#3180)

    This PR:

    1. Adds a new interpretation for the Anoma effect, which makes gRPC
    calls to an existing Anoma client instead of spawning a new one.
    2. Adds a new `nockma run` mode, `with-client`, which can be used to run
    an Anoma program against a running Anoma client, using its URL and gRPC
    port.
    3. separates the `nockma run` command into subcommands.

    CLI docs:

    ## `nockma run`

    ```
    Usage: juvix dev nockma run COMMAND

      Subcommands used to run an Anoma program. Use with artefacts obtained from
      compilation with the anoma target

    Available options:
      -h,--help                Show this help text

    Available commands:
      builtin-evaluator        Run with the builtin Nockma evaluator
      ephemeral-client         Run with an ephemeral Anoma client
      with-client              Run with a running Anoma client
    ```

    ### `with-client`

    ```
    Usage: juvix dev nockma run with-client
             NOCKMA_FILE [--args ARGS_FILE] (-p|--grpc-port PORT) [--url URL]

      Run with a running Anoma client

    Available options:
      NOCKMA_FILE              Path to a .nockma file
      --args ARGS_FILE         Path to file containing args. The args file should
                               contain a list (i.e. to pass 2 and [1 4] as args, the
                               contents should be [2 [1 4] 0]).
      -p,--grpc-port PORT      The GRPC port of a running Anoma client
      --url URL                The URL of a running Anoma client. default: localhost
      -h,--help                Show this help text
    ```

    ### `ephemeral-client`

    ```
    Usage: juvix dev nockma run ephemeral-client
             NOCKMA_FILE [--args ARGS_FILE] --anoma-dir ANOMA_DIR

      Run with an ephemeral Anoma client

    Available options:
      NOCKMA_FILE              Path to a .nockma file
      --args ARGS_FILE         Path to file containing args. The args file should
                               contain a list (i.e. to pass 2 and [1 4] as args, the
                               contents should be [2 [1 4] 0]).
      --anoma-dir ANOMA_DIR    Path to anoma repository
      -h,--help                Show this help text
    ```

    ### `builtin-evaluator`

    ```
    Usage: juvix dev nockma run builtin-evaluator
             NOCKMA_FILE [--args ARGS_FILE] [--profile]

      Run with the builtin Nockma evaluator

    Available options:
      NOCKMA_FILE              Path to a .nockma file
      --args ARGS_FILE         Path to file containing args. The args file should
                               contain a list (i.e. to pass 2 and [1 4] as args, the
                               contents should be [2 [1 4] 0]).
      --profile                Report evaluator profiling statistics
      -h,--help                Show this help text
    ```

commit 455249db4d
Author: Łukasz Czajka <62751+lukaszcz@users.noreply.github.com>
Date:   Tue Nov 19 20:34:52 2024 +0100

    HTML generation: make the light theme lighter (#3168)

    * Closes #3141
    * Adds the `latte-light` theme with lighter background and makes it the
    default. This is a bit subjective, but in my opinion the light theme
    should not have a background darker than the browser window pane. It
    should be close to white.

commit eab02a77da
Author: Paul Cadman <git@paulcadman.dev>
Date:   Tue Nov 19 17:34:13 2024 +0000

    Remove `GetAnomaProcess` from the Anoma effect (#3179)

    This PR removes `GetAnomaProcess` from the Anoma effect.

    Use the `launchAnoma` function to start a persistent Anoma client /
    server (used by `juvix dev anoma node`).

    Other changes:

    * It's no longer necessary to pass the protobuf files to `grpcurl`
    because the Anoma client now supports gRPC reflection.
    * We pass the elixir start command to `mix` via `-e` argument instead of
    using a temporary file.

    The purpose for this change is that we I want to add an interpreter for
    Anoma that makes gRPC calls to an exisitng Anoma client.
    `GetAnomaProcess` has no meaning for this interpreter.
2024-11-20 18:34:04 +01:00
Paul Cadman
19ecfa931b
Set std_in to NoStream on the Anoma client process (#3182)
This PR sets `std_in` to `NoStream` on the Anoma client process.


https://hackage.haskell.org/package/process-1.6.25.0/docs/System-Process.html#t:StdStream

We do not read from the Anoma client process stdin so we do not need to
open a handle to stdin.

This fixes an issue where the Anoma client stdin does not get cleaned up
correctly on exit which causes subsequent input to the terminal to be
corrupted.
2024-11-20 17:07:52 +00:00
Łukasz Czajka
2e38aa609f
Unify type signature declaration syntax (#3178)
* Closes #2990 
* Allows type signatures for constructors, record fields and axioms to
have the same form as in function definitions, e.g.,
```
field {A} {{M A}} (arg1 arg2 : A) : List A
```
* For constructors, this introduces an ambiguity between record and GADT
syntax with names. For example,
```
ctr {
  A : Type
}
```
can be confused by the parser with initial part of GADT type signature:
```
ctr {A : Type} : A -> C A
```
For now, this is resolved by preferring the record syntax. Hence, it's
currently not possible to use type signatures with implicit arguments
for constructors. Ultimately, the `@` in record syntax should be made
mandatory, which would resolve the ambiguity:
```
ctr@{
  A : Type
}
```

---------

Co-authored-by: Jan Mas Rovira <janmasrovira@gmail.com>
2024-11-20 15:57:15 +00:00
Paul Cadman
865842046d
Support running nockma code with a running Anoma client (#3180)
This PR:

1. Adds a new interpretation for the Anoma effect, which makes gRPC
calls to an existing Anoma client instead of spawning a new one.
2. Adds a new `nockma run` mode, `with-client`, which can be used to run
an Anoma program against a running Anoma client, using its URL and gRPC
port.
3. separates the `nockma run` command into subcommands.

CLI docs:

## `nockma run`

```
Usage: juvix dev nockma run COMMAND

  Subcommands used to run an Anoma program. Use with artefacts obtained from
  compilation with the anoma target

Available options:
  -h,--help                Show this help text

Available commands:
  builtin-evaluator        Run with the builtin Nockma evaluator
  ephemeral-client         Run with an ephemeral Anoma client
  with-client              Run with a running Anoma client
```

### `with-client`

```
Usage: juvix dev nockma run with-client
         NOCKMA_FILE [--args ARGS_FILE] (-p|--grpc-port PORT) [--url URL]

  Run with a running Anoma client

Available options:
  NOCKMA_FILE              Path to a .nockma file
  --args ARGS_FILE         Path to file containing args. The args file should
                           contain a list (i.e. to pass 2 and [1 4] as args, the
                           contents should be [2 [1 4] 0]).
  -p,--grpc-port PORT      The GRPC port of a running Anoma client
  --url URL                The URL of a running Anoma client. default: localhost
  -h,--help                Show this help text
```

### `ephemeral-client`

```
Usage: juvix dev nockma run ephemeral-client
         NOCKMA_FILE [--args ARGS_FILE] --anoma-dir ANOMA_DIR

  Run with an ephemeral Anoma client

Available options:
  NOCKMA_FILE              Path to a .nockma file
  --args ARGS_FILE         Path to file containing args. The args file should
                           contain a list (i.e. to pass 2 and [1 4] as args, the
                           contents should be [2 [1 4] 0]).
  --anoma-dir ANOMA_DIR    Path to anoma repository
  -h,--help                Show this help text
```

### `builtin-evaluator`

```
Usage: juvix dev nockma run builtin-evaluator
         NOCKMA_FILE [--args ARGS_FILE] [--profile]

  Run with the builtin Nockma evaluator

Available options:
  NOCKMA_FILE              Path to a .nockma file
  --args ARGS_FILE         Path to file containing args. The args file should
                           contain a list (i.e. to pass 2 and [1 4] as args, the
                           contents should be [2 [1 4] 0]).
  --profile                Report evaluator profiling statistics
  -h,--help                Show this help text
```
2024-11-20 08:53:21 +01:00
Łukasz Czajka
455249db4d
HTML generation: make the light theme lighter (#3168)
* Closes #3141 
* Adds the `latte-light` theme with lighter background and makes it the
default. This is a bit subjective, but in my opinion the light theme
should not have a background darker than the browser window pane. It
should be close to white.
2024-11-19 19:34:52 +00:00
Paul Cadman
eab02a77da
Remove GetAnomaProcess from the Anoma effect (#3179)
This PR removes `GetAnomaProcess` from the Anoma effect.

Use the `launchAnoma` function to start a persistent Anoma client /
server (used by `juvix dev anoma node`).

Other changes:

* It's no longer necessary to pass the protobuf files to `grpcurl`
because the Anoma client now supports gRPC reflection.
* We pass the elixir start command to `mix` via `-e` argument instead of
using a temporary file.

The purpose for this change is that we I want to add an interpreter for
Anoma that makes gRPC calls to an exisitng Anoma client.
`GetAnomaProcess` has no meaning for this interpreter.
2024-11-19 17:34:13 +00:00
Paul Cadman
dc2d268413
Fix long opts for nockma encode from/to (#3177)
The `from` and `to` long options for `juvix dev nockma encode` were
mislabelled. `from` should be the source encoding and `to` should be the
target encoding.
2024-11-15 18:36:55 +00:00
Łukasz Czajka
5f803ec6c2
Named arguments for record projections (#3173)
* Closes #3054
* Adds named argument signatures for generated record projections.
2024-11-15 18:25:49 +01:00
Łukasz Czajka
9f25ffde16
Detect termination for nested local definitions (#3169)
* Closes #3147 

When we call a function that is currently being defined (there may be
several such due to nested local definitions), we add a reflexive edge
in the call map instead of adding an edge from the most nested
definition. For example, for

```juvix
go {A B} (f : A -> B) : List A -> List B
  | nil := nil
  | (elem :: next) :=
    let var1 := f elem;
        var2 := go f next;
    in var1 :: var2;
```

we add an edge from `go` to the recursive call `go f next`, instead of
adding an edge from `var2` to `go f next` as before.

This makes the above type-check.

The following still doesn't type-check, because `next'` is not a
subpattern of the clause pattern of `go`. But this is a less pressing
problem.

```juvix
go {A B} (f : A -> B) : List A -> List B
  | nil := nil
  | (elem :: next) :=
    let var1 := f elem;
        var2 (next' : List A) : List B := go f next';
    in myCons var1 (var2 next);
```
2024-11-15 12:30:18 +01:00
Jan Mas Rovira
1d7bf1f25b
Fix compiler error on import cycles (#3171)
- Fixes #3161 

The strongly connected components given in [this
function](https://hackage.haskell.org/package/containers-0.7/docs/Data-Graph.html#v:stronglyConnComp)
are not guaranteed to give a cycle in the order they are given. I've
fixed that
2024-11-15 09:41:02 +01:00
Paul Cadman
49c14be71e
Fix nock compilation and builtin evaluation of sha256 stdilb (#3175)
This PR:

1. Fixes the compilation of the sha256 builtin anoma lib call

A sha256 hash is 32 bytes long, not 64 bytes. This number is used when
constructing the ByteArray representation (i.e `[length payload]` cell)
of the output of Anoma stdlib sha256 call. The Anoma stdlib sha256 call
just returns the atom payload.

2. Fixes the evaluation of the sha256 stdlib call

Previously we were converting the sha256 hash bytestring to Base16
format. This is convenient when displaying the ByteString hash. However
the Anoma nock interpreter outputs the raw bytes so we must change the
builtin evaluator to match this behaviour.

After these fixes we can re-enable the test084 anoma compilation test.
2024-11-14 18:54:39 +01:00
Paul Cadman
29041dcb32
Launch the Anoma node and client from the elixir REPL (#3172)
This PR changes how we launch the Anoma Client to avoid a bug with
linking cryptographic APIs.

libsodium cryptographic APIs like sign-detached cannot currently be
called from within the Anoma node or client binaries. Until this is
solved we must start both the node and client from the elixir REPL.
Previously we were starting the node using the REPL and the client using
the binary.

This commit changes the `start.exs` script we were using to start the
node to now start both a node and a client.

After this change we can enable Anoma compilation test `test077`.

The output of `juvix dev anoma node --anoma-dir ANOMA_DIR` is now:

```
Anoma node and client successfully started
Listening on port 51748
```
2024-11-14 09:10:00 +01:00
Paul Cadman
2b2c8abb25
Use tagged version of ghc-musl in static linux build (#3170)
The issue with alpine ncurses packaging has been fixed upstream and the
ghc-musl containers have been rebuilt. Therefore we can resume using the
tagged releases of the ghc-musl container.

https://github.com/benz0li/ghc-musl/issues/10

Thanks @benz0li for help with diagnosing and fixing this issue.

Co-authored-by: Olivier Benz <olivier.benz@b-data.ch>
2024-11-13 19:17:48 +01:00
Jan Mas Rovira
536ba6cea2
Nockma mode (#3163)
Support for emacs
[nockma-mode](https://github.com/anoma/juvix-mode/pull/25). The list of
features is given in the link.

It adds the following commands:
1. `juvix dev nockma ide check`. Parses a nockma file (used by flycheck
only).
2. `juvix dev nockma ide highlight`. Highlights a nockma file.
3. `juvix dev nockma ide rules`. Shows all evaluation rules properly
highlighted in emacs.
2024-11-13 15:41:06 +00:00
Jan Mas Rovira
200daad1dc
Fix bug in ComputeTypeInfo for let (#3158)
- Fixes #3030 

The `ComputeTypeInfo` transformation was incorrectly assuming that the
type of the body couldn't refer to the let item. When inferring the type
of a let, we now inline the let item(s) into the type of the body.

```
NLet Let {..} ->
   let bodyTy = Info.getNodeType _letBody
   in subst (_letItem ^. letItemValue) bodyTy
```
2024-11-12 16:44:25 +01:00
Paul Cadman
5d586cb85c
Add merged pull requests for 0.6.{7,8} to CHANGELOG (#3167) 2024-11-11 19:47:08 +00:00
Paul Cadman
bebe3d121d
Release 0.6.8 (#3165)
The purpose of this release is to add support for the `--vscode` flag,
required by an update to the juvix vscode extension.

* https://github.com/anoma/juvix/pull/3162
* https://github.com/anoma/vscode-juvix/pull/153

This PR updates:

- [x] Package version
- [x] Smoke test

The CHANGELOG generator we use:
https://github.com/github-changelog-generator/github-changelog-generator
has stopped working with errors like the following:

```
Warning: PR 3148 merge commit was not found in the release branch or tagged git history and no rebased SHA comment was found
```

So we'll defer populating the CHANGELOG summary until after the release.
2024-11-11 17:08:17 +01:00
Łukasz Czajka
76af2124b2
Don't write log messages to stdout (#3159)
The "Cloning (...)" message was written to stdout which messed up
markdown generation.
2024-11-11 14:31:37 +00:00
Łukasz Czajka
fc0d5a3d88
Add --vscode option (#3162)
* Add a `--vscode` option which causes the error messages to be printed
without newlines, in a way compatible with the problem matcher of the
VSCode extension
* Related VSCode extension PR:
https://github.com/anoma/vscode-juvix/pull/153
2024-11-11 10:06:57 +01:00
Jan Mas Rovira
75d7167856
Add NFData instance for Core.Module (#3160)
It can be useful for debugging, benchmarking and improving efficiency.
2024-11-08 13:14:12 +00:00
Jan Mas Rovira
ca56b6b0cd
Support traces in the anoma node (#3152)
This pr adds support for getting traces from the anoma node.
I've updated the test suite so that tests that were disabled because of
traces are now being run.
There are a few tests that require atention:
1. `test028`: Gives the wrong answer.
2. `test084`: Gives the wrong answer.
4. `test074`: Expected to fail because it uses scry.
5. `test086`: Expected to fail because Anoma representation of prngs is
different than the juvix representation.
2024-11-08 11:54:17 +00:00
Paul Cadman
6ed5e136b6
Add option to run Anoma tests in non-debug mode (#3144)
> ⚠️ Based on https://github.com/anoma/juvix/pull/3142

When using AnomaTestModeFull the compilation tests are run in debug
mode, with stdlib interception and run using the raw nock (without
stdlib interception).

---------

Co-authored-by: Jan Mas Rovira <janmasrovira@gmail.com>
2024-11-07 13:11:41 +00:00
Paul Cadman
0714391900
Release 0.6.7 (#3153)
This PR updates:

- [x] Package version
- [x] Smoke test

The CHANGELOG generator we use:
https://github.com/github-changelog-generator/github-changelog-generator
has stopped working with errors like the following:

```
Warning: PR 3148 merge commit was not found in the release branch or tagged git history and no rebased SHA comment was found
```

So we'll defer populating the CHANGELOG summary until after the release
2024-11-07 09:50:18 +00:00
Paul Cadman
2a463a00a2
Fix StdlibRandomNextBytes call (#3150)
The hoon code that generates the stdlib call is:


1a8b632463/src/Juvix/Compiler/Nockma/AnomaLib.hs (L101)

i.e the random number generator is the first argument and the width is
the second argument. We have the arguments transposed in the
corresponding Juvix builtin API so the call was failing.

This PR transposes the argumetns in the stdlib call so the builtin API
and hoon generated nock code are compatible.
2024-11-07 09:05:13 +01:00
Paul Cadman
4a1350a783
Use nockmaEq instead of Eq instance to detect nil terminator (#3149)
`unfoldList` should work with for lists like:

* `[5 0]`
* `[5 nil]`
* `[5 tag@myNilTag 0]`
* etc.

currently `unfoldList` will work only for list `nil` terminators that
are tagged with `unfoldList`. `nockmaEq` compares nock terms ignoring
debug annotations, so the above lists will work correctly.
2024-11-06 19:28:38 +01:00
Paul Cadman
1a8b632463
Update juvix-stdlib ref to latest main (#3148)
This PR updates the juvix-stdlib submodule ref to the latest main
branch.

It incorporates changes from:

* https://github.com/anoma/juvix-stdlib/pull/134
2024-11-06 15:52:58 +00:00
Jan Mas Rovira
bf09ee2888
Add dev nockma encode command (#3135)
- New command `juvix dev nockma encode --help`
```
Usage: juvix dev nockma encode --to ENCODING --from ENCODING

  Encode and decode nockma terms

Available options:
  --to ENCODING            Choose the source encoding.
                           • base64: Jam and Base 64 encoding
                           • bytes: Jam encoding
                           • debug: Nockma code with annotations
                           • text: Nockma code without annotations
  --from ENCODING          Choose the target encoding.
                           • base64: Jam and Base 64 encoding
                           • bytes: Jam encoding
                           • debug: Nockma code with annotations
                           • text: Nockma code without annotations
```
2024-11-06 10:01:33 +01:00
Jan Mas Rovira
0961d874d3
juvix dev nockma run --anoma-dir ./anoma --args are given as a nockma list (#3142)
When we run nockma code in the anoma node, the arguments should be given
as a nockma list. I.e. a nil terminated tuple.
2024-11-05 17:11:24 +01:00
Paul Cadman
663cd85bcc
Anoma client verbose request response (#3140)
Use:

```
juvix --log-level=verbose dev nockma run --anoma-dir ~/heliax/anoma Identity.nockma --args args.debug.nockma
```

To print out the JSON request and response payload used in the Anoma
Client RPC call.
2024-11-05 14:50:19 +00:00
Jan Mas Rovira
4cdcb2f747
Add anoma nockma tests (#3134)
* Fixes a bug in calling Anoma stdlib from Nock code
* Runs the anoma compilation test with the anoma node nockma evaluator.

I've classified the tests in 4 categories:
1. `Working`. The test works as expected.
2. `Trace`. We need more work on our end to get the traces from the
anoma node and check that they match the expected result.
3. `NodeError`. The anoma node returns `failed to prove the nock
program`.
4. `Wrong`. The anoma node returns some value that does not match the
expected value.

---------

Co-authored-by: Lukasz Czajka <lukasz@heliax.dev>
Co-authored-by: Łukasz Czajka <62751+lukaszcz@users.noreply.github.com>
Co-authored-by: Paul Cadman <git@paulcadman.dev>
2024-11-05 13:28:28 +00:00
Łukasz Czajka
3030196fdd Non-recursive definitions (#3138)
* Closes #2968 
* Implements detection of function-like definitions, which either:
  - have some arguments on the left of `:`, or
  - have at least one clause.
* Only function-like definitions are recursive.
* Non-recursive definitions are not mutually recursive either, and can
be used only after their definition. This necessitates rearranging some
definitions in existing Juvix code.
* Changes the scoping of identifiers in record updates. Now field names
on the right side don't refer to the old values of the record fields but
to identifiers in scope defined outside the record update. To refer to
old values, one needs to explicitly use record projections, e.g.
```
r@Rec{x := Rec.x r}
```
2024-11-04 18:18:39 +01:00
Jan Mas Rovira
71161ffecd
Fix package-base interaction (#3139)
- Fixes #3009 
- Fixes #2877
- TODO think if this makes https://github.com/anoma/juvix/issues/2985
slightly easier to fix
2024-11-01 14:42:18 +00:00
Łukasz Czajka
a43f73ab2c
Stdlib: add functions to the Map module (#3136)
Co-authored-by: Paul Cadman <git@paulcadman.dev>
2024-11-01 11:04:22 +00:00
Łukasz Czajka
95275ca5c1
Detect constant side conditions in matches (#3133)
* Closes #3007 
* Depends on #3101 
* Detects side conditions which are `true` (removes the condition) or
`false` (removes the branch).
2024-11-01 09:50:19 +00:00