1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-03 09:41:10 +03:00
juvix/tests
Łukasz Czajka 7c039d687b
Specialization optimisation (#2164)
* Closes #2147 

Adds a `specialize` pragma which allows to specify (explicit) arguments
considered for specialization. Whenever a function is applied to a
constant known value for the specialized argument, a new version of the
function will be created with the argument pasted in. For example, the
code

```juvix
{-# specialize: [1] #-}
mymap : {A B : Type} -> (A -> B) -> List A -> List B;
mymap f nil := nil;
mymap f (x :: xs) := f x :: mymap f xs;

main : Nat;
main := length (mymap λ{x := x + 3} (1 :: 2 :: 3 :: 4 :: nil));
```

will be transformed into code equivalent to

```juvix
mymap' : (Nat -> Nat) -> List Nat -> List Nat;
mymap' f nil := nil;
mymap' f (x :: xs) := λ{x := x + 3} x :: mymap' xs;

main : Nat;
main := length (mymap' (1 :: 2 :: 3 :: 4 :: nil));
```
2023-06-26 16:49:19 +02:00
..
Asm New compilation pipeline (#1832) 2023-03-14 16:24:07 +01:00
benchmark Fix runtime C maybe benchmark example (#2195) 2023-06-16 09:54:13 +01:00
Compilation Specialization optimisation (#2164) 2023-06-26 16:49:19 +02:00
Core Add Bottom node (#2112) 2023-05-23 18:31:28 +02:00
examplesExpected Add a test suite for milestone examples (#1920) 2023-03-24 13:16:26 +00:00
Geb/positive VampIR integration (#2103) 2023-05-22 20:18:18 +02:00
Internal Fix reachability analysis with imports in unreachable nested modules (#2062) 2023-05-12 09:53:30 +01:00
negative Iterator syntax (#2126) 2023-05-30 15:30:11 +02:00
positive Store source location of (almost) everything (#2174) 2023-06-07 19:57:51 +02:00
runtime/positive Respect fixity in runtime printer (#2182) 2023-06-07 11:44:41 +02:00
smoke/Commands Bump version to 0.4.1 and update CHANGELOG (#2225) 2023-06-23 12:39:27 +01:00
VampIR The public pragma (#2223) 2023-06-22 18:31:53 +02:00
.gitattributes Juvix C runtime (#1580) 2022-11-03 09:38:09 +01:00