I am not entirely sure what the intent was for that keyword, but
nothing really matched between the parser, the formatter and the uplc
code gen. I don't think there's any need for a keyword here, trace is
already readily available from the builtins.
Before:
```
❯ aiken check
Error:
× No such file or directory (os error 2)
```
After:
```
❯ aiken check
Error:
× Missing 'aiken.toml' manifest in /Users/ktorz/Documents/Projects/aiken-lang/aiken
help: Try running `aiken new <REPOSITORY/PROJECT>` to initialise a project with an example manifest.
```
Co-authored-by: KtorZ <matthias.benkort@gmail.com>
This is the most intuitive thing I could come up with: since the
problem is mainly due to the order in which we try declaring the
aliases, then it suffices to simply try as much as we can, and retry
on failure until there's no more failure.
Note that it's important to detect cycles if we do such thing (which
we can by noticing that a given iteration didn't make any progress).
It works pretty well in the end and even allow us to define a new kind
of type error should there be a cyclic definition.
- Make sure to credit the original author of Gleam, from which Aiken gets a lot of inspiration.
- Adds CF & TxPipe as new maintainers / copyrighters moving on.
```
Error:
× Main thread panicked.
├─▶ at crates/lang/src/uplc.rs:1897:45
╰─▶ called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
```
```
Error:
× Main thread panicked.
├─▶ at crates/lang/src/uplc.rs:2395:56
╰─▶ called `Result::unwrap()` on an `Err` value: FreeUnique(Name { text: "test_insert", unique:
Unique(1) })
```
```
Error:
× Main thread panicked.
├─▶ at /Users/ktorz/Documents/Projects/aiken-lang/aiken/crates/project/src/lib.rs:640:36
╰─▶ called `Result::unwrap()` on an `Err` value: FreeUnique(Name { text: "test_foo", unique:
Unique(0) })
```
```
Error:
× Main thread panicked.
├─▶ at /Users/ktorz/Documents/Projects/aiken-lang/aiken/crates/project/src/lib.rs:620:22
╰─▶ called `Result::unwrap()` on an `Err` value: FreeUnique(Name { text:
"test_foldr_list_int_data_list_int", unique: Unique(10) })
```
```
× map2_3 failed
help: ┍━ left ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┑
│ Type mismatch expected 'integer' got 'pair data data' │
┕━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┙
should be equal to
┍━ right ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┑
│ Type mismatch expected 'list pair data data' got 'list data' │
┕━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┙
```
It's best to keep builtin as-close-as possible to their standard name
because they're hard to document. We can then leverage the prelude and
the standard lib for convenient names.
This is because there's no proper way to catch panics in Rust, which
makes it hard to know _which_ test did cause the panic when this
happen. The stack trace gives little detail about this, but we can
print this information before it happens -- making it easier to
identify the culprit.
```
Error: 020/lib/test.ak
× map_2 failed
help: ┍━ left ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┑
│ Type mismatch expected 'integer' got 'data' │
┕━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┙
should be equal to
┍━ right ━━━━━━━━━━━━━━━━┑
│ (con data #d8799f0fff) │
┕━━━━━━━━━━━━━━━━━━━━━━━━┙
```