Commit Graph

900 Commits

Author SHA1 Message Date
Matthias Benkort
127581a445 Merge pull request #199 from aiken-lang/acceptance-test-021-type-alias-definition
Fix acceptance 021: allow registering type aliases in any order.
2022-12-21 10:07:03 +01:00
KtorZ
28c907d9de Fix acceptance 021: allow registering type aliases in any order.
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.
2022-12-21 09:43:37 +01:00
KtorZ
a3591cc7dc Fix 'aiken new', now require project name in specific format. 2022-12-21 00:19:24 +01:00
rvcas
796ac28044 feat: change the printing a little 2022-12-20 16:32:31 -05:00
rvcas
0b204beb58 chore: turn off cargo audit for now 2022-12-20 16:32:31 -05:00
rvcas
e34cbc8e7e feat: compile deps 2022-12-20 16:32:31 -05:00
rvcas
b06bf610b7 feat: dep downloading now works 2022-12-20 16:32:31 -05:00
rvcas
6a0b1ce5c3 feat: start trying to use deps 2022-12-20 16:32:31 -05:00
rvcas
5bd2a9336c feat: tons of boilerplate for fetching packages 2022-12-20 16:32:31 -05:00
rvcas
34f9029a57 chore: fix lock file 2022-12-20 16:32:31 -05:00
rvcas
a6fd8f92a8 feat(deps): start laying out some types and functions 2022-12-20 16:32:31 -05:00
rvcas
b3266fb837 chore: clippy warnings 2022-12-20 16:32:31 -05:00
Kasey White
ac14512706 feat: fix nil equals nil, and fix funcs with discard params 2022-12-20 15:40:01 -05:00
Kasey White
9177267570 feat: test 24 passes
fixed issue with is_tuple in types
minor monomorphize change
2022-12-20 15:40:01 -05:00
Kasey White
17603e8cca checkpoint 2022-12-20 15:40:01 -05:00
KtorZ
f9761e8ade Recommend installing latest git head from README (instead of latest cargo crate) 2022-12-20 09:23:41 +01:00
KtorZ
730c5a3314 Adjust logo's size on README. 2022-12-20 09:20:31 +01:00
KtorZ
b22f9df0d1 Tweak LICENSE
- 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.
2022-12-20 05:47:13 +01:00
KtorZ
102bb7735e Add new integration test scenario 031
```
  × clamp_1 failed
  help: ┍━ left ━━━━━━━━━━┑
        │ (con integer 0) │
        ┕━━━━━━━━━━━━━━━━━┙

        should be equal to

        ┍━ right ━━━━━━━━━━┑
        │ (con integer 10) │
        ┕━━━━━━━━━━━━━━━━━━┙
  ```
2022-12-20 04:48:03 +01:00
KtorZ
030172e1dc Add new acceptance test scenario 030
```
  Error:
    × Main thread panicked.
    ├─▶ at crates/lang/src/uplc.rs:1897:45
    ╰─▶ called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
  ```
2022-12-20 04:37:55 +01:00
KtorZ
58c123a930 Add new intgration test scenario 029
```
  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) })
  ```
2022-12-20 04:21:28 +01:00
KtorZ
daa3fa5d33 Add new acceptance test scenario 028
```
  Error:
    × Main thread panicked.
    ├─▶ at crates/lang/src/builder.rs:1257:30
    ╰─▶ internal error: entered unreachable code
  ```
2022-12-20 02:55:01 +01:00
KtorZ
fec7431d11 Add new acceptance test scenario 027
```
  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) })
  ```
2022-12-20 02:32:43 +01:00
KtorZ
8bd4fd0cda Add new acceptance test scenario
```
  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) })
  ```
2022-12-20 02:22:04 +01:00
KtorZ
fccad9e7dd Add new acceptance test scenario 025
```
  help: ┍━ left ━━━━━━━━┑
        │ (con unit ()) │
        ┕━━━━━━━━━━━━━━━┙

        should be equal to

        ┍━ right ━━━━━━━┑
        │ (con unit ()) │
        ┕━━━━━━━━━━━━━━━┙
  ```
2022-12-20 01:07:15 +01:00
KtorZ
f511b2f71b Add new acceptance test scenario 024
```
  × 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' │
        ┕━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┙
  ```
2022-12-19 18:55:50 +01:00
KtorZ
dbd3d3fd7d Add new acceptance test scenario 023
```
  Error:
    × Main thread panicked.
    ├─▶ at crates/lang/src/uplc.rs:2830:32
    ╰─▶ called `Option::unwrap()` on a `None` value
  ```
2022-12-19 18:51:46 +01:00
Kasey White
43ff66cd01 all tests pass besides todo in 13, couple changes
Use more cost efficient recurse
Monomorphize needed to deal with function arg return types
bytearray variant added for variant names
2022-12-19 00:41:27 -05:00
KtorZ
b6556e6739 Rework 'new' to not generate needless boilerplate
Instead, prints out a README with useful informations.
2022-12-19 00:41:27 -05:00
Kasey White
421e7148d0 zero arg functions now work: test 15 2022-12-19 00:41:27 -05:00
Kasey White
3a765ddef5 add better todo 2022-12-19 00:41:27 -05:00
KtorZ
529b3e87ff Rename builtin as 'verify_ed25519_signature'
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.
2022-12-19 00:41:27 -05:00
KtorZ
a51808d549 Add new acceptance test scenario (022)
```
  thread 'main' has overflowed its stack
  fatal runtime error: stack overflo
  ```
2022-12-19 00:41:27 -05:00
KtorZ
44d72c046e Print files / tests as they're processed when --debug
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.
2022-12-19 00:41:27 -05:00
Kasey White
eb386f4606 feat: Add nil support for test 19 2022-12-19 00:41:27 -05:00
Kasey White
5b908aaeb7 fix: fieldsexpose getting wrong generic id and not replacing type 2022-12-19 00:41:27 -05:00
Kasey White
47fae21af7 minor fix to monomorphize 2022-12-19 00:41:27 -05:00
Kasey White
2bce818110 chore: fix list insertion order, function insertion order,
and Inner function issues with variant
2022-12-19 00:41:27 -05:00
KtorZ
0d0e698d5e Add new acceptance test scenario (021)
```
  Error: aiken::check

    × Checking
    ╰─▶ Unknown type

        VerificationKey

     ╭─[021/lib/test.ak:4:1]
   4 │ pub type PoolId =
   5 │   Hash<VerificationKey>
     ·        ───────────────
   6 │
     ╰────
  ```
2022-12-19 00:41:27 -05:00
KtorZ
ed58a1cac7 Add new acceptance test scenario (020)
```
  Error: 020/lib/test.ak

    × map_2 failed
    help: ┍━ left ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┑
          │ Type mismatch expected 'integer' got 'data' │
          ┕━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┙

          should be equal to

          ┍━ right ━━━━━━━━━━━━━━━━┑
          │ (con data #d8799f0fff) │
          ┕━━━━━━━━━━━━━━━━━━━━━━━━┙
  ```
2022-12-19 00:41:27 -05:00
KtorZ
e3ea511b79 Add new acceptance test scenario (019)
```
  Error:
    × Main thread panicked.
    ├─▶ at crates/lang/src/uplc.rs:2001:81
    ╰─▶ called `Option::unwrap()` on a `None` value
  ```
2022-12-19 00:41:27 -05:00
KtorZ
287fbf2e3b Add new acceptance test scenario (018)
```
  Error: examples/acceptance_tests/018/lib/test.ak

    × or_else_2 failed
    help: ┍━ left ━━━━━━━━━━━┑
          │ (con data #182a) │
          ┕━━━━━━━━━━━━━━━━━━┙

          should be equal to

          ┍━ right ━━━━━━━━━━┑
          │ (con integer 42) │
          ┕━━━━━━━━━━━━━━━━━━┙
  ```
2022-12-19 00:41:27 -05:00
Kasey White
e6c59dca2c cleanup if then else a bit 2022-12-19 00:41:27 -05:00
Kasey White
eddd202253 tests 1 through 10 pass now, add negate 2022-12-19 00:41:27 -05:00
KtorZ
6e46e7562e Add new acceptance test scenario (017)
```
  Error:
    × Main thread panicked.
    ├─▶ at /Users/ktorz/Documents/Projects/aiken-lang/aiken/crates/project/src/lib.rs:596:22
    ╰─▶ called `Result::unwrap()` on an `Err` value: FreeUnique(Name { text: "test_slice", unique:
        Unique(6) })
  ```
2022-12-19 00:41:27 -05:00
KtorZ
00b800c456 Add new acceptance test scenario (016)
```
  Error:
    × Main thread panicked.
    ├─▶ at /Users/ktorz/Documents/Projects/aiken-lang/aiken/crates/project/src/lib.rs:616:36
    ╰─▶ called `Result::unwrap()` on an `Err` value: FreeUnique(Name { text: "test_slice", unique:
        Unique(7) })
  ```
2022-12-19 00:41:27 -05:00
rvcas
febe6345eb chore: retire assets folder in favor of new repo 2022-12-17 11:19:02 -05:00
rvcas
841babae5c chore: clean some links up so they point to the new repo 2022-12-17 11:19:02 -05:00
KtorZ
1055e342b1 Tweak syntax-highlighting for better output. 2022-12-17 17:09:13 +01:00
Matthias Benkort
53eab4b3fd Merge pull request #185 from aiken-lang/aiken-docs
Aiken docs
2022-12-17 13:14:11 +01:00