Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Commit

Permalink
closes #383 - index type of for loops
Browse files Browse the repository at this point in the history
  • Loading branch information
signorecello committed Oct 10, 2023
1 parent 64aec2a commit 7bb178d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/language_concepts/02_control_flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ for i in 0..10 {
};
```

The index for loops is of type `u64`.

## If Expressions

Noir supports `if-else` statements. The syntax is most similar to Rust's where it is not required
Expand Down
12 changes: 11 additions & 1 deletion docs/migration_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ keywords: [Noir, notes, migration, updating, upgrading]

Noir is in full-speed development. Things break fast, wild, and often. This page attempts to leave some notes on errors you might encounter when upgrading and how to resolve them until proper patches are built.

## ≥0.14

The index of the [for loops](./language_concepts/02_control_flow.md#loops) is now of type `u64` instead of `Field`. An example refactor would be:

```rust
for i in 0..10 {
let i = i as Field;
}
```

## ≥v0.11.0 and Nargo backend

From this version onwards, Nargo starts managing backends through the `nargo backend` command. Upgrading to the versions per usual steps might lead to:
Expand Down Expand Up @@ -60,7 +70,7 @@ nargo backend install acvm-backend-barretenberg https://github.com/noir-lang/bar

This downloads and installs a specific bb.js based version of barretenberg binary from GitHub.

The gzipped filed is running this bash script: https://github.com/noir-lang/barretenberg-js-binary/blob/master/run-bb-js.sh, where we need to gzip it as the Nargo currently expect the backend to be zipped up.
The gzipped filed is running this bash script: <https://github.com/noir-lang/barretenberg-js-binary/blob/master/run-bb-js.sh>, where we need to gzip it as the Nargo currently expect the backend to be zipped up.

Then run:

Expand Down

0 comments on commit 7bb178d

Please sign in to comment.