From 1660fb7365b9e7e30d5b802ba2258750a6513a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Tue, 10 Oct 2023 08:53:41 +0100 Subject: [PATCH 01/15] closes #390 - multidimensional arrays --- docs/language_concepts/data_types/04_arrays.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/language_concepts/data_types/04_arrays.md b/docs/language_concepts/data_types/04_arrays.md index f826b39..bdbd179 100644 --- a/docs/language_concepts/data_types/04_arrays.md +++ b/docs/language_concepts/data_types/04_arrays.md @@ -63,6 +63,13 @@ let array: [Field; 32] = [0; 32]; let sl = array.as_slice() ``` +You can define multidimensional arrays: + +```rust +let array : [[Field; 2]; 2]; +let element = array[0][0]; +``` + ## Types You can create arrays of primitive types or structs. There is not yet support for nested arrays From 24838a1ace0e0d45818488d4f700159a0bf26d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Tue, 10 Oct 2023 09:06:56 +0100 Subject: [PATCH 02/15] closes #386 - escape sequences --- .../data_types/03_strings.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/language_concepts/data_types/03_strings.md b/docs/language_concepts/data_types/03_strings.md index ee69853..6cc731f 100644 --- a/docs/language_concepts/data_types/03_strings.md +++ b/docs/language_concepts/data_types/03_strings.md @@ -41,3 +41,23 @@ fn main() { assert(message_bytes[0] == message_vec.get(0)); } ``` + +## Escape characters + +You can use escape characters for your strings, as much as escape sequences: + +| Escape Sequence | Description | +|-----------------|-----------------| +| `\r` | Carriage Return | +| `\n` | Newline | +| `\t` | Tab | +| `\0` | Null Character | +| `\"` | Double Quote | +| `\\` | Backslash | + +Example: + +```rust +let s = "Hello \"world" // prints "Hello "world" +let s = "hey \tyou"; // prints "Hello world" +``` From 64aec2abc77b7a595065dbcb35d8d133ce7c9d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Tue, 10 Oct 2023 09:24:05 +0100 Subject: [PATCH 03/15] closes #385 - vectors --- .../data_types/06_vectors.mdx | 149 ++++++++++++++++++ 1 file changed, 149 insertions(+) diff --git a/docs/language_concepts/data_types/06_vectors.mdx b/docs/language_concepts/data_types/06_vectors.mdx index 7cbfbd8..2869d16 100644 --- a/docs/language_concepts/data_types/06_vectors.mdx +++ b/docs/language_concepts/data_types/06_vectors.mdx @@ -21,3 +21,152 @@ for i in 0..5 { } assert(vector.len() == 5); ``` + +## Methods + +### new + +Creates a new, empty vector. + +```rust +pub fn new() -> Self { + Self { slice: [] } +} +``` + +example: + +```rust +let empty_vector: Vec = Vec::new(); +assert(empty_vector.len() == 0); +``` + +### from_slice + +Creates a vector containing each element from a given slice. Mutations to the resulting vector will not affect the original slice. + +```rust +pub fn from_slice(slice: [T]) -> Self { + Self { slice } +} +``` + +example: + +```rust +let arr: [Field] = [1, 2, 3]; +let vector_from_slice = Vec::from_slice(arr); +assert(vector_from_slice.len() == 3); +``` + +### get + +Retrieves an element from the vector at a given index. Panics if the index points beyond the vector's end. + +```rust +pub fn get(self, index: Field) -> T { + self.slice[index] +} +``` + +example: + +```rust +let vector: Vec = Vec::from_slice([10, 20, 30]); +assert(vector.get(1) == 20); +``` + +### push + +Adds a new element to the vector's end, returning a new vector with a length one greater than the original unmodified vector. + +```rust +pub fn push(&mut self, elem: T) { + self.slice = self.slice.push_back(elem); +} +``` + +example: + +```rust +let mut vector: Vec = Vec::new(); +vector.push(10); +assert(vector.len() == 1); +``` + +### pop + +Removes an element from the vector's end, returning a new vector with a length one less than the original vector, along with the removed element. Panics if the vector's length is zero. + +```rust +pub fn pop(&mut self) -> T { + let (popped_slice, last_elem) = self.slice.pop_back(); + self.slice = popped_slice; + last_elem +} +``` + +example: + +```rust +let mut vector = Vec::from_slice([10, 20]); +let popped_elem = vector.pop(); +assert(popped_elem == 20); +assert(vector.len() == 1); +``` + +### insert + +Inserts an element at a specified index, shifting subsequent elements to the right. + +```rust +pub fn insert(&mut self, index: Field, elem: T) { + self.slice = self.slice.insert(index, elem); +} +``` + +example: + +```rust +let mut vector = Vec::from_slice([10, 30]); +vector.insert(1, 20); +assert(vector.get(1) == 20); +``` + +### remove + +Removes an element at a specified index, shifting subsequent elements to the left, and returns the removed element. + +```rust +pub fn remove(&mut self, index: Field) -> T { + let (new_slice, elem) = self.slice.remove(index); + self.slice = new_slice; + elem +} +``` + +example: + +```rust +let mut vector = Vec::from_slice([10, 20, 30]); +let removed_elem = vector.remove(1); +assert(removed_elem == 20); +assert(vector.len() == 2); +``` + +### len + +Returns the number of elements in the vector. + +```rust +pub fn len(self) -> Field { + self.slice.len() +} +``` + +example: + +```rust +let empty_vector: Vec = Vec::new(); +assert(empty_vector.len() == 0); +``` From 7bb178db5f3d470130aea0d393053ae3165664be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Tue, 10 Oct 2023 09:28:33 +0100 Subject: [PATCH 04/15] closes #383 - index type of for loops --- docs/language_concepts/02_control_flow.md | 2 ++ docs/migration_notes.md | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/language_concepts/02_control_flow.md b/docs/language_concepts/02_control_flow.md index 691c514..a7f8536 100644 --- a/docs/language_concepts/02_control_flow.md +++ b/docs/language_concepts/02_control_flow.md @@ -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 diff --git a/docs/migration_notes.md b/docs/migration_notes.md index 84c1508..48a8abc 100644 --- a/docs/migration_notes.md +++ b/docs/migration_notes.md @@ -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: @@ -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: , where we need to gzip it as the Nargo currently expect the backend to be zipped up. Then run: From d08fe516f599d2e3a9df97ed79b73a534110527f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Tue, 10 Oct 2023 09:36:17 +0100 Subject: [PATCH 05/15] closes #382 - pub modifier for functions --- docs/language_concepts/01_functions.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/language_concepts/01_functions.md b/docs/language_concepts/01_functions.md index 7cb43c4..2b5f29a 100644 --- a/docs/language_concepts/01_functions.md +++ b/docs/language_concepts/01_functions.md @@ -14,6 +14,12 @@ To declare a function the `fn` keyword is used. fn foo() {} ``` +By default, functions are visible only within the package they are defined. To make them visible outside of that package (for example, as part of a [library](../modules_packages_crates/crates_and_packages.md#libraries)), you should mark them as `pub`: + +```rust +pub fn foo() {} +``` + All parameters in a function must have a type and all types are known at compile time. The parameter is pre-pended with a colon and the parameter type. Multiple parameters are separated using a comma. From 58f168144dbe4c523778b3cfefddcc269369f970 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Tue, 10 Oct 2023 10:16:38 +0100 Subject: [PATCH 06/15] closes #367 - should fail with reason --- docs/nargo/02_testing.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/nargo/02_testing.md b/docs/nargo/02_testing.md index 106952c..da76727 100644 --- a/docs/nargo/02_testing.md +++ b/docs/nargo/02_testing.md @@ -40,3 +40,22 @@ fn test_add() { assert(add(2,2) == 5); } ``` + +You can be more specific and make it fail with a specific reason by using `should_fail_with = "`: + +```rust +fn main(african_swallow_avg_speed : Field) { + assert(african_swallow_avg_speed == 65, "What is the airspeed velocity of an unladen swallow"); +} + +#[test] +fn test_king_arthur() { + main(65); +} + +#[test(should_fail_with = "What is the airspeed velocity of an unladen swallow")] +fn test_bridgekeeper() { + main(32); +} + +``` From 47a1ccf3fbc8b5f4c179e7283fda7216aa418463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Tue, 10 Oct 2023 10:23:58 +0100 Subject: [PATCH 07/15] closes #361 - testing panel in vscode --- docs/getting_started/03_language_server.md | 4 ++++ static/img/codelens_testing_panel.png | Bin 0 -> 18339 bytes 2 files changed, 4 insertions(+) create mode 100644 static/img/codelens_testing_panel.png diff --git a/docs/getting_started/03_language_server.md b/docs/getting_started/03_language_server.md index ce3a33b..8a81d72 100644 --- a/docs/getting_started/03_language_server.md +++ b/docs/getting_started/03_language_server.md @@ -28,6 +28,10 @@ When you language server is running correctly and the VSCode plugin is installed ![Compile and Execute](./../../static/img/codelens_compile_execute.png) ![Run test](../../static/img/codelens_run_test.png) +You should also see your tests in the `testing` panel: + +![Testing panel](./../../static/img/codelens_testing_panel.png) + ### Configuration * __Noir: Enable LSP__ - If checked, the extension will launch the Language Server via `nargo lsp` and communicate with it. diff --git a/static/img/codelens_testing_panel.png b/static/img/codelens_testing_panel.png new file mode 100644 index 0000000000000000000000000000000000000000..cec1708d405082b11b9f6eab681f88895452a46e GIT binary patch literal 18339 zcmZU41z1#F+chzCgQRpS5<@o(poDZNDV@^Y-I4;*DXDaKw{(Z3ba&T(#^?Fo@4f!d zYer_~oPG8_d+)RFb+5H{n4-KS1}X_E3=9m0wA5Q=7#P?@;By}`BJlroCb>Ke3~G+K zxVWOUxHzSvy^V>vr7;YQRM@u!Bvln@!oKa6ix_N5U*Gt#)C&U0dt~M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 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Tue, 10 Oct 2023 10:26:15 +0100 Subject: [PATCH 08/15] closes #349 - moving lsp page --- .../03_language_server.md => nargo/04_language_server.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/{getting_started/03_language_server.md => nargo/04_language_server.md} (100%) diff --git a/docs/getting_started/03_language_server.md b/docs/nargo/04_language_server.md similarity index 100% rename from docs/getting_started/03_language_server.md rename to docs/nargo/04_language_server.md From 1a91be4535e8e12e11b9cc673c66dfc60122b443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Tue, 10 Oct 2023 10:32:13 +0100 Subject: [PATCH 09/15] closes #335 - unifying nix instructions --- docs/getting_started/00_nargo_installation.md | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/docs/getting_started/00_nargo_installation.md b/docs/getting_started/00_nargo_installation.md index b963fdd..654d427 100644 --- a/docs/getting_started/00_nargo_installation.md +++ b/docs/getting_started/00_nargo_installation.md @@ -153,31 +153,7 @@ Commands: help Print this message or the help of the given subcommand(s) ``` -### Option 3: Install via Nix - -Due to the large number of native dependencies, Noir projects can be installed via [Nix](https://nixos.org/). - -#### Installing Nix - -For the best experience, please follow these instructions to setup Nix: - -1. Install Nix following [their guide](https://nixos.org/download.html) for your operating system. -2. Create the file `~/.config/nix/nix.conf` with the contents: - -```ini -experimental-features = nix-command -extra-experimental-features = flakes -``` - -#### Install Nargo into your Nix profile - -1. Use `nix profile` to install Nargo - -```sh -nix profile install github:noir-lang/noir -``` - -### Option 4: Compile from Source +### Option 3: Compile from Source Due to the large number of native dependencies, Noir projects uses [Nix](https://nixos.org/) and [direnv](https://direnv.net/) to streamline the development experience. From b29e6c3416cf7f53a130349e47c3accc2c0641b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Tue, 10 Oct 2023 10:43:13 +0100 Subject: [PATCH 10/15] closes #219 - explains why we use nix --- docs/getting_started/00_nargo_installation.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/getting_started/00_nargo_installation.md b/docs/getting_started/00_nargo_installation.md index 654d427..26a665a 100644 --- a/docs/getting_started/00_nargo_installation.md +++ b/docs/getting_started/00_nargo_installation.md @@ -155,7 +155,9 @@ Commands: ### Option 3: Compile from Source -Due to the large number of native dependencies, Noir projects uses [Nix](https://nixos.org/) and [direnv](https://direnv.net/) to streamline the development experience. +Due to the large number of native dependencies, Noir projects uses [Nix](https://nixos.org/) and [direnv](https://direnv.net/) to streamline the development experience. It helps mitigating ssues commonly associated with dependency management, such as conflicts between required package versions for different projects (often referred to as "dependency hell"). + +Combined with direnv, which automatically sets or unsets environment variables based on the directory, it further simplifies the development process by seamlessly integrating with the developer's shell, facilitating an efficient and reliable workflow for managing and deploying Noir projects with multiple dependencies. #### Setting up your environment From 5dbad8bd9b0db43af8755f65840bcb83355ec14e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Tue, 10 Oct 2023 11:04:05 +0100 Subject: [PATCH 11/15] broken link --- docs/getting_started/02_breakdown.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/getting_started/02_breakdown.md b/docs/getting_started/02_breakdown.md index 3fa3a35..bc0e742 100644 --- a/docs/getting_started/02_breakdown.md +++ b/docs/getting_started/02_breakdown.md @@ -196,5 +196,3 @@ verify the proof submitted against it. If the verification passes, additional fu verifier contract could trigger (e.g. approve the asset transfer). Now that you understand the concepts, you'll probably want some editor feedback while you are writing more complex code. - -In the [next section](language_server), we will explain how to utilize the Noir Language Server. From c98c5f3eddbde82d91fc2dd380d573e9e1f45dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Tue, 10 Oct 2023 21:07:58 +0100 Subject: [PATCH 12/15] Update docs/language_concepts/data_types/06_vectors.mdx Co-authored-by: josh crites --- docs/language_concepts/data_types/03_strings.md | 2 +- docs/language_concepts/data_types/06_vectors.mdx | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/language_concepts/data_types/03_strings.md b/docs/language_concepts/data_types/03_strings.md index 6cc731f..5619d62 100644 --- a/docs/language_concepts/data_types/03_strings.md +++ b/docs/language_concepts/data_types/03_strings.md @@ -59,5 +59,5 @@ Example: ```rust let s = "Hello \"world" // prints "Hello "world" -let s = "hey \tyou"; // prints "Hello world" +let s = "hey \tyou"; // prints "hey you" ``` diff --git a/docs/language_concepts/data_types/06_vectors.mdx b/docs/language_concepts/data_types/06_vectors.mdx index 2869d16..296cd13 100644 --- a/docs/language_concepts/data_types/06_vectors.mdx +++ b/docs/language_concepts/data_types/06_vectors.mdx @@ -34,7 +34,7 @@ pub fn new() -> Self { } ``` -example: +Example: ```rust let empty_vector: Vec = Vec::new(); @@ -51,7 +51,7 @@ pub fn from_slice(slice: [T]) -> Self { } ``` -example: +Example: ```rust let arr: [Field] = [1, 2, 3]; @@ -69,7 +69,7 @@ pub fn get(self, index: Field) -> T { } ``` -example: +Example: ```rust let vector: Vec = Vec::from_slice([10, 20, 30]); @@ -125,7 +125,7 @@ pub fn insert(&mut self, index: Field, elem: T) { } ``` -example: +Example: ```rust let mut vector = Vec::from_slice([10, 30]); @@ -145,7 +145,7 @@ pub fn remove(&mut self, index: Field) -> T { } ``` -example: +Example: ```rust let mut vector = Vec::from_slice([10, 20, 30]); @@ -164,7 +164,7 @@ pub fn len(self) -> Field { } ``` -example: +Example: ```rust let empty_vector: Vec = Vec::new(); From 0c51f31526c7b2c4ae07a2f695e1d47c46f558e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Tue, 10 Oct 2023 21:16:46 +0100 Subject: [PATCH 13/15] adding corrections, thanks @critesjosh --- docs/language_concepts/data_types/03_strings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/language_concepts/data_types/03_strings.md b/docs/language_concepts/data_types/03_strings.md index 5619d62..c42f34e 100644 --- a/docs/language_concepts/data_types/03_strings.md +++ b/docs/language_concepts/data_types/03_strings.md @@ -44,7 +44,7 @@ fn main() { ## Escape characters -You can use escape characters for your strings, as much as escape sequences: +You can use escape characters for your strings: | Escape Sequence | Description | |-----------------|-----------------| From 5e747b0636bd3ff2b47a1147fe856ac6f7fa033d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Tue, 10 Oct 2023 21:28:09 +0100 Subject: [PATCH 14/15] Update docs/language_concepts/data_types/06_vectors.mdx Co-authored-by: josh crites --- docs/language_concepts/data_types/06_vectors.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/language_concepts/data_types/06_vectors.mdx b/docs/language_concepts/data_types/06_vectors.mdx index 296cd13..b8ef925 100644 --- a/docs/language_concepts/data_types/06_vectors.mdx +++ b/docs/language_concepts/data_types/06_vectors.mdx @@ -106,7 +106,7 @@ pub fn pop(&mut self) -> T { } ``` -example: +Example: ```rust let mut vector = Vec::from_slice([10, 20]); From 9342791c10f390281a08c239cf9fb1a1fa8b2e27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Tue, 10 Oct 2023 21:28:45 +0100 Subject: [PATCH 15/15] Update docs/language_concepts/data_types/06_vectors.mdx Co-authored-by: josh crites --- docs/language_concepts/data_types/06_vectors.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/language_concepts/data_types/06_vectors.mdx b/docs/language_concepts/data_types/06_vectors.mdx index b8ef925..4d3406f 100644 --- a/docs/language_concepts/data_types/06_vectors.mdx +++ b/docs/language_concepts/data_types/06_vectors.mdx @@ -86,7 +86,7 @@ pub fn push(&mut self, elem: T) { } ``` -example: +Example: ```rust let mut vector: Vec = Vec::new();