Commit Graph

94 Commits

Author SHA1 Message Date
KtorZ
4316d5c382 Factor out common project-logic between build and check. 2022-10-28 17:20:41 +02:00
KtorZ
8d45b2a2f5 Enforce ordering of commands/sub-commands according to source
By default, clap orders command alphabetically, which can be quite
    confusing when listing commands with `--help`:

    ```
    SUBCOMMANDS:
        eval      Evaluate an Untyped Plutus Core program
        flat      Encode textual Untyped Plutus Core to flat bytes
        fmt       Format an Untyped Plutus Core program
        help      Print this message or the help of the given subcommand(s)
        unflat    Decode flat bytes to textual Untyped Plutus Cor
    ```

    It is possible to instrument clap to order commands in the same way
    they are declared in the source, giving us back the freedom to order
    and group them in a manner that makes sense, e.g.:

    ```
    SUBCOMMANDS:
        fmt       Format an Untyped Plutus Core program
        eval      Evaluate an Untyped Plutus Core program
        flat      Encode textual Untyped Plutus Core to flat bytes
        unflat    Decode flat bytes to textual Untyped Plutus Cor
        help      Print this message or the help of the given subcommand(s)
    ```
2022-10-28 17:20:41 +02:00
KtorZ
9c608ad9f1 Refactor cli's crate; split code into a hierarchy of modules.
This follows a simple convention:

    - `main.rs` contains as little as possible and delegates both
      data-types definitions and command executions to sub-modules.

    - modules are named after their respective commands. For
      sub-commands,

    - Each command module can be in one of two forms:

      - Either it is a leaf command, and it then contains an `Args`
	struct that defines the command arguments; and a function
	`exec` when outlines the execution logic.

      - Or, it is a group command with multiple sub-commands. In which
	case the module defines a `Cmd` struct encapsulating all
	sub-commands; and also an `exec` function which simply
	dispatches the logic to sub-functions.

    ---

    This commit also removes the `dev` command which is currently
    unused. The rationale being: if it's not there, it's not there.
2022-10-28 17:20:39 +02:00
KtorZ
6d0d938fb9 Extra project utilities in their own crate.
This was currently in the 'cli' crates, but this code is pretty standalone and need not to be mixed with the rest of the cli logic.
  Ideally, we want the cli crate to be only a thin wrapper over functionality available from the rest of the lib crates.
2022-10-28 13:48:40 +02:00
rvcas
819256df99 feat: wrap up adding uplc builtins for now 2022-10-25 18:52:27 -04:00
rvcas
d5d2ba9cd7 feat: start creating aiken/builtin module 2022-10-25 18:52:27 -04:00
rvcas
a41d05f7b6 feat: change project structure 2022-10-24 00:09:00 -04:00
rvcas
825783ca61 feat: typecheck If expressions 2022-10-24 00:09:00 -04:00
rvcas
5244e58c9f feat: typechecking is working 2022-10-24 00:09:00 -04:00
rvcas
cabc653167 feat: start expr inference 2022-10-24 00:09:00 -04:00
rvcas
81c87ab4da feat: register import, types, and values in environment 2022-10-24 00:09:00 -04:00
rvcas
d0287d418b feat: add prelude 2022-10-24 00:09:00 -04:00
rvcas
4df3de0a03 feat: some boilerplate for typechecking 2022-10-24 00:09:00 -04:00
rvcas
ed2ef4fa9b feat: sort modules and detect cycles 2022-10-24 00:09:00 -04:00
alessandrokonrad
a14dae5863 changed slot_length to u32 2022-10-17 08:35:45 -04:00
rvcas
6e7ea45e11 fix: flip the cbor_hex if condition 2022-10-13 10:56:04 -04:00
rvcas
da89e9902c feat: starting to get pretty error messages 2022-10-11 14:34:27 -04:00
rvcas
59d7b54473 feat: start integrating miette 2022-10-11 14:34:27 -04:00
rvcas
57dc50e3aa chore: temp allow dead code 2022-10-09 15:39:28 -04:00
rvcas
03d4a6f1e1 chore: rename 2022-10-09 15:39:28 -04:00
rvcas
ff26db2245 feat: start project building 2022-10-09 15:39:28 -04:00
rvcas
6de41e64be feat: add simple check command 2022-10-04 17:09:43 -04:00
rvcas
4f26957806 feat: some expr with precendence parsing 2022-09-26 11:14:42 -04:00
rvcas
c08f6a8454 Merge branch 'main' into lang 2022-09-25 17:44:20 -04:00
rvcas
08596588a7 feat: output total budget spent from cli 2022-09-24 20:23:51 -04:00
rvcas
8620332b75 feat: move input from json to helper method 2022-09-24 19:40:07 -04:00
alessandrokonrad
35d09c642b fixed time conversion 2022-09-24 23:59:58 +02:00
rvcas
f10e3836ad feat: new error for bad term 2022-09-19 11:04:21 -04:00
rvcas
6c34c9be19 feat: even more errors work 2022-09-19 01:05:33 -04:00
rvcas
9e280f9cb5 feat: rename transaction eval and add error enum 2022-09-18 15:35:10 -04:00
rvcas
68fc0f643e feat: add some v1 methods so that cost_mdls can be optional 2022-09-18 15:16:41 -04:00
Kasey White
472cea6c41 parameratize cost model 2022-09-17 21:12:48 -04:00
Kasey White
02a8a34fe8 expose tx simulation with simulate cli command 2022-09-16 04:35:20 -04:00
Kasey White
3f27bd9f13 move utils to uplc and break up 2022-09-16 04:00:29 -04:00
rvcas
26deb6df10 fix: it compiles again 2022-09-15 11:27:33 -04:00
rvcas
348ed3b719 fix: changes from pallas bump
Co-authored-by: Kasey White <kwhitemsg@gmail.com>
2022-09-14 22:00:52 -04:00
alessandrokonrad
806d98e5fc added error messages to execution purpose 2022-09-14 18:52:05 -04:00
alessandrokonrad
fc92c40c3c fixed typo 2022-09-14 18:52:05 -04:00
alessandrokonrad
2bd46f90bb error statemens after program 2022-09-14 18:52:05 -04:00
alessandrokonrad
829d959fa3 more error statements 2022-09-14 18:52:05 -04:00
alessandrokonrad
a408491e41 added error messages 2022-09-14 18:52:05 -04:00
alessandrokonrad
be8daa00dd added plutusV1 test 2022-09-14 18:52:04 -04:00
alessandrokonrad
6e4ff1e282 added plutusV1 2022-09-14 18:52:04 -04:00
alessandrokonrad
d9b34973c7 fixed constructor tags 2022-09-14 18:52:04 -04:00
alessandrokonrad
61bf55e151 added example 2022-09-14 18:52:04 -04:00
alessandrokonrad
eb1466d269 fixed budget calc 2022-09-14 18:52:04 -04:00
alessandrokonrad
fa6520e585 added full evaluation; still fails because hashes mismatch regarding pallas 2022-09-14 18:52:04 -04:00
alessandrokonrad
76d326b9ac completed execution part 2022-09-14 18:52:04 -04:00
alessandrokonrad
b1b9d3a5d4 preliminary work on execution 2022-09-14 18:52:04 -04:00
alessandrokonrad
080985b7c6 more bug fixes 2022-09-14 18:52:04 -04:00