1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-24 16:12:14 +03:00
Juvix empowers developers to write code in a high-level, functional language, compile it to gas-efficient output VM instructions, and formally verify the safety of their contracts prior to deployment and execution.
Go to file
Łukasz Czajka 7db74442d4
Hoisting of loop-invariant subexpressions (#3195)
* Closes #3028 
* Detects fully-applied expressions of the form
```
f a (\{ x1 .. xk := body }) a'
```
where `f` is a recursive function which does not modify its function
argument (the one for which a lambda is provided), i.e., passes it to
recursive invocations unchanged (it's the second argument in the above
example). A function `f` satisfying this requirement implements some
kind of loop with the lambda-expression usually being the loop body /
action.

Let e.g. `body = g x1 .. xk b1 b2` where `b1`, `b2` do not contain any
variables bound in the lambda (`x1`,..,`xk`). If `b1`, `b2` are
non-trivial (require computation), then these loop-invariant
subexpressions are hoisted outside of the loop, obtaining:
```
let 
  y1 := b1;
  y2 := b2;
in
f a (\{ x1 .. xk := g x1 .. xk y1 y2) a'
```
* Adds a volatility info in Core which prevents the lets created by
loop-invariant expression hoisting from being folded back.
* Removes potential duplication in the specialization optimization.
* Adds another optimization phase before lambda-lifting where hoisting
of loop-invariant subexpressions is performed. This allows to reduce the
number of iterations in the main optimization phase after
lambda-lifting.
2024-12-03 11:21:09 +01:00
.devcontainer Upgrade to ghc-9.8.2 (#2794) 2024-06-08 14:43:33 +02:00
.github Fix Anoma in the CI (#3213) 2024-12-02 16:16:59 +01:00
app Make juvix init non-interactive by default (#3206) 2024-12-02 18:07:37 +01:00
assets HTML generation: make the light theme lighter (#3168) 2024-11-19 19:34:52 +00:00
bench Fix benchmark runtime variant (#2740) 2024-04-22 11:09:27 +01:00
bench2 Rename Nockma stdlib to anomalib and add RM references (#3111) 2024-10-21 13:28:37 +02:00
config Detect empty standard library directory (#3207) 2024-12-02 10:58:11 +01:00
examples Formatter improvements (#3194) 2024-11-29 11:49:47 +01:00
gnuplot Automatized benchmarks (#1673) 2023-01-05 17:48:26 +01:00
include Add juvix dev anoma add-transaction command (#3193) 2024-11-29 18:09:45 +00:00
juvix-stdlib@0c456725a2 Hoisting of loop-invariant subexpressions (#3195) 2024-12-03 11:21:09 +01:00
licenses Remove unused files (#2398) 2023-09-28 14:20:19 +02:00
runtime Enable Anoma compilation resource machine builtin tests (#3208) 2024-12-02 14:09:55 +01:00
scripts Support for Cairo builtins (#2718) 2024-04-16 19:01:30 +02:00
src Hoisting of loop-invariant subexpressions (#3195) 2024-12-03 11:21:09 +01:00
test Hoisting of loop-invariant subexpressions (#3195) 2024-12-03 11:21:09 +01:00
tests Hoisting of loop-invariant subexpressions (#3195) 2024-12-03 11:21:09 +01:00
.clang-format Juvix C runtime (#1580) 2022-11-03 09:38:09 +01:00
.github_changelog_generator Update Changelog v0.2.3 🎉 2022-08-15 12:24:42 +02:00
.gitignore Rust runtime (#2782) 2024-05-22 12:26:51 +02:00
.gitmodules Rename MiniJuvix to Juvix (#259) 2022-07-08 13:59:45 +02:00
.hlint.yaml Add default arguments (#2408) 2023-10-10 23:28:06 +02:00
.pre-commit-config.yaml Add an if instruction to JuvixReg (#2855) 2024-06-26 19:08:33 +02:00
cabal.hie.yaml Automatized benchmarks (#1673) 2023-01-05 17:48:26 +01:00
cabal.project Revert GHC 9.10.1 update (#3052) 2024-09-19 21:02:43 +01:00
cabal.project.freeze Revert GHC 9.10.1 update (#3052) 2024-09-19 21:02:43 +01:00
CHANGELOG.md Add merged pull requests for 0.6.{7,8} to CHANGELOG (#3167) 2024-11-11 19:47:08 +00:00
cntlines.sh Non-recursive definitions (#3138) 2024-11-04 18:18:39 +01:00
CODING.md Improve function argument names in the standard library (#3127) 2024-10-28 13:29:50 +01:00
CONTRIBUTING.md Fix baseUrl for juvix docs in Doctor command (#2122) 2023-05-24 12:14:30 +02:00
justfile Compile-time configuration (#3102) 2024-10-16 11:47:23 +02:00
LICENSE.md Add new README and md files (#1904) 2023-03-21 20:01:48 +01:00
Makefile Compile-time configuration (#3102) 2024-10-16 11:47:23 +02:00
package.yaml Add juvix dev anoma {start, stop, status} to manage an Anoma client (#3183) 2024-11-22 16:03:30 +00:00
README.md Update license reference (#3108) 2024-10-17 14:00:17 +01:00
stack.hie.yaml Refactor hie.yaml and add entry in the readme (#1672) 2022-12-20 16:45:48 +01:00
stack.yaml Revert GHC 9.10.1 update (#3052) 2024-09-19 21:02:43 +01:00

Juvix

Tara the Juvix mascot

CI Status

The Juvix compiler CI

Nightly build, release and benchmark

Codebase
Open the Juvix Standard Lib in Github Codespace

This repository is specifically dedicated to the compiler of the Juvix programming language.

For any Juvix-related inquiries, we strongly advise visiting the following resources.

Our documentation offers an in-depth understanding of the Juvix programming language. It encompasses a language reference, examples, blog posts, and numerous other resources to facilitate effective use of Juvix.