IntersectMBO / IntersectMBO/plutus
Investigate call-by-need semantics for `force`-`delay`
Open
Internal
optimization
status: triaged
Untyped Plutus Core
- Dominant language
- Haskell
- Stars
- 1.6k
- Forks
- 508
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 22
Description
Currently the following UPLC pseudocode:
```
let y = delay e
in f (\_ -> force y) + g (\_ -> force y)
```
will evaluate `e` twice if both `f` and `g` evaluate `force y` once.
If we used some sort of call-by-need semantics specifically for `delay` and `force`, `e` would only be evaluated twice.
This is worth investigating, I believe.
Contributor guide
Assessment
This issue has not been assessed yet.