1
1
mirror of https://github.com/anoma/juvix.git synced 2024-09-11 16:26:33 +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
Jan Mas Rovira d08bf942b6
Add front-end support for case expressions boolean side conditions (#2852)
- Syntax for #2804.
- ⚠️ Depends on #2869.

This pr introduces:
1. front-end support (parsing, printing, typechecking) for boolean side
conditions for branches of case expressions.
2. Now `if` is a reserved keyword.
3. Multiway `if` is allowed to have only the `else` branch. I've also
refactored the parser to be simpler.

Example:
```
 multiCaseBr : Nat :=
    case 1 of
      | zero
        | if 0 < 0 := 3
        | else := 4
      | suc (suc n)
        | if 0 < 0 := 3
        | else := n
      | suc n if 0 < 0 := 3;
```
The side if branches must satisfy the following.
1. There must be at least one `if` branch.
4. The `else` branch is optional. If present, it must be the last.

Future work:
1. Translate side if conditions to Core and extend the exhaustiveness
algorithm.
5. Add side if conditions to function clauses.
2024-07-04 01:16:30 +02:00
.devcontainer Upgrade to ghc-9.8.2 (#2794) 2024-06-08 14:43:33 +02:00
.github Cairo: untagged record representation (#2853) 2024-06-25 10:29:39 +02:00
app Improve performance of formatting a project (#2863) 2024-07-01 18:05:24 +02:00
assets Fix typos (#2573) 2024-01-08 13:27:18 +01:00
bench Fix benchmark runtime variant (#2740) 2024-04-22 11:09:27 +01:00
bench2 Add support for anoma-decode builtin (#2775) 2024-05-15 18:30:17 +01:00
examples Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
gnuplot Automatized benchmarks (#1673) 2023-01-05 17:48:26 +01:00
include Make Maybe a builtin inductive type (#2860) 2024-06-26 17:12:29 +01:00
juvix-stdlib@89a5960fb8 Update juvix-stdlib to main ref (#2871) 2024-07-02 11:23:41 +01:00
licenses Remove unused files (#2398) 2023-09-28 14:20:19 +02:00
runtime Peephole optimization of Cairo assembly (#2858) 2024-06-27 12:41:27 +02:00
scripts Support for Cairo builtins (#2718) 2024-04-16 19:01:30 +02:00
src Add front-end support for case expressions boolean side conditions (#2852) 2024-07-04 01:16:30 +02:00
test Adapt Anoma builtins to new Anoma Node API (#2861) 2024-07-01 18:44:02 +01:00
tests Add front-end support for case expressions boolean side conditions (#2852) 2024-07-04 01:16:30 +02: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 Upgrade to ghc-9.8.2 (#2794) 2024-06-08 14:43:33 +02:00
cabal.project.freeze Upgrade to ghc-9.8.2 (#2794) 2024-06-08 14:43:33 +02:00
CHANGELOG.md Release 0.6.3 (#2870) 2024-07-02 12:37:45 +01:00
cntlines.sh Cairo: Support complex data types in program input (#2822) 2024-06-13 12:37:01 +02:00
CONTRIBUTING.md Fix baseUrl for juvix docs in Doctor command (#2122) 2023-05-24 12:14:30 +02:00
justfile just format uses ghc flags in juvix.cabal (#2844) 2024-06-20 11:30:04 +02:00
LICENSE.md Add new README and md files (#1904) 2023-03-21 20:01:48 +01:00
Makefile Rust runtime (#2782) 2024-05-22 12:26:51 +02:00
package.yaml Release 0.6.3 (#2870) 2024-07-02 12:37:45 +01:00
README.md Fix tara url svg (#2406) 2023-09-28 19:05:05 +02:00
stack.hie.yaml Refactor hie.yaml and add entry in the readme (#1672) 2022-12-20 16:45:48 +01:00
stack.yaml Upgrade to ghc-9.8.2 (#2794) 2024-06-08 14:43:33 +02: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.