diff --git a/docs/language_concepts/data_types/05_slices.md b/docs/language_concepts/data_types/05_slices.mdx similarity index 90% rename from docs/language_concepts/data_types/05_slices.md rename to docs/language_concepts/data_types/05_slices.mdx index b506d13..7fd0722 100644 --- a/docs/language_concepts/data_types/05_slices.md +++ b/docs/language_concepts/data_types/05_slices.mdx @@ -1,17 +1,12 @@ --- title: Slices -description: - Explore the Slice data type in Noir. Understand its methods, see real-world examples, and learn how to effectively use Slices in your Noir programs. -keywords: - [ - noir, - slice type, - methods, - examples, - subarrays, - ] +description: Explore the Slice data type in Noir. Understand its methods, see real-world examples, and learn how to effectively use Slices in your Noir programs. +keywords: [noir, slice type, methods, examples, subarrays] --- +import Experimental from '../../../src/components/Notes/_experimental.mdx'; + + A slice is a dynamically-sized view into a sequence of elements. They can be resized at runtime, but because they don't own the data, they cannot be returned from a circuit. You can treat slices as arrays without a constrained size. diff --git a/docs/language_concepts/data_types/06_vectors.md b/docs/language_concepts/data_types/06_vectors.md deleted file mode 100644 index ec8a4cc..0000000 --- a/docs/language_concepts/data_types/06_vectors.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: Vectors -description: - Delve into the Vector data type in Noir. Learn about its methods, practical examples, and best practices for using Vectors in your Noir code. -keywords: - [ - noir, - vector type, - methods, - examples, - dynamic arrays, - ] ---- - -A vector is a collection type similar to Rust's Vector type. It's convenient way to use slices as mutable arrays. - -Example: - -```rust -use dep::std::collections::vec::Vec; - -let mut vector: Vec = Vec::new(); -for i in 0..5 { - vector.push(i); -} -assert(vector.len() == 5); -``` diff --git a/docs/language_concepts/data_types/06_vectors.mdx b/docs/language_concepts/data_types/06_vectors.mdx new file mode 100644 index 0000000..7cbfbd8 --- /dev/null +++ b/docs/language_concepts/data_types/06_vectors.mdx @@ -0,0 +1,23 @@ +--- +title: Vectors +description: Delve into the Vector data type in Noir. Learn about its methods, practical examples, and best practices for using Vectors in your Noir code. +keywords: [noir, vector type, methods, examples, dynamic arrays] +--- + +import Experimental from '../../../src/components/Notes/_experimental.mdx'; + + + +A vector is a collection type similar to Rust's Vector type. It's convenient way to use slices as mutable arrays. + +Example: + +```rust +use dep::std::collections::vec::Vec; + +let mut vector: Vec = Vec::new(); +for i in 0..5 { + vector.push(i); +} +assert(vector.len() == 5); +``` diff --git a/docs/standard_library/cryptographic_primitives/00_hashes.mdx b/docs/standard_library/cryptographic_primitives/00_hashes.mdx index 1d9b1c7..bb2621b 100644 --- a/docs/standard_library/cryptographic_primitives/00_hashes.mdx +++ b/docs/standard_library/cryptographic_primitives/00_hashes.mdx @@ -7,7 +7,7 @@ keywords: [cryptographic primitives, Noir project, sha256, blake2s, pedersen, mimc_bn254, mimc, hash] --- -import BlackBoxInfo from './common/_blackbox.mdx'; +import BlackBoxInfo from '../../../src/components/Notes/_blackbox.mdx'; ## sha256 diff --git a/docs/standard_library/cryptographic_primitives/01_scalar.mdx b/docs/standard_library/cryptographic_primitives/01_scalar.mdx index ce6b694..0d79908 100644 --- a/docs/standard_library/cryptographic_primitives/01_scalar.mdx +++ b/docs/standard_library/cryptographic_primitives/01_scalar.mdx @@ -4,7 +4,7 @@ description: See how you can perform scalar multiplications over a fixed base in keywords: [cryptographic primitives, Noir project, scalar multiplication] --- -import BlackBoxInfo from './common/_blackbox.mdx'; +import BlackBoxInfo from '../../../src/components/Notes/_blackbox.mdx'; ## scalar_mul::fixed_base_embedded_curve diff --git a/docs/standard_library/cryptographic_primitives/02_schnorr.mdx b/docs/standard_library/cryptographic_primitives/02_schnorr.mdx index 0e219c0..73737eb 100644 --- a/docs/standard_library/cryptographic_primitives/02_schnorr.mdx +++ b/docs/standard_library/cryptographic_primitives/02_schnorr.mdx @@ -4,7 +4,7 @@ description: Learn how you can verify Schnorr signatures using Noir keywords: [cryptographic primitives, Noir project, schnorr, signatures] --- -import BlackBoxInfo from './common/_blackbox.mdx'; +import BlackBoxInfo from '../../../src/components/Notes/_blackbox.mdx'; ## schnorr::verify_signature diff --git a/docs/standard_library/cryptographic_primitives/03_ecdsa_sig_verification.mdx b/docs/standard_library/cryptographic_primitives/03_ecdsa_sig_verification.mdx index 3934a03..25185b0 100644 --- a/docs/standard_library/cryptographic_primitives/03_ecdsa_sig_verification.mdx +++ b/docs/standard_library/cryptographic_primitives/03_ecdsa_sig_verification.mdx @@ -4,7 +4,7 @@ description: Learn about the cryptographic primitives regarding ECDSA over the s keywords: [cryptographic primitives, Noir project, ecdsa, secp256k1, secp256r1, signatures] --- -import BlackBoxInfo from './common/_blackbox.mdx'; +import BlackBoxInfo from '../../../src/components/Notes/_blackbox.mdx'; Noir supports ECDSA signatures verification over the secp256k1 and secp256r1 curves. diff --git a/docs/standard_library/cryptographic_primitives/05_eddsa.mdx b/docs/standard_library/cryptographic_primitives/05_eddsa.mdx index 8f060ed..39dfb60 100644 --- a/docs/standard_library/cryptographic_primitives/05_eddsa.mdx +++ b/docs/standard_library/cryptographic_primitives/05_eddsa.mdx @@ -4,7 +4,7 @@ description: Learn about the cryptographic primitives regarding EdDSA keywords: [cryptographic primitives, Noir project, eddsa, signatures] --- -import BlackBoxInfo from './common/_blackbox.mdx'; +import BlackBoxInfo from '../../../src/components/Notes/_blackbox.mdx'; ## eddsa::eddsa_poseidon_verify diff --git a/docs/standard_library/cryptographic_primitives/common/_blackbox.mdx b/src/components/Notes/_blackbox.mdx similarity index 100% rename from docs/standard_library/cryptographic_primitives/common/_blackbox.mdx rename to src/components/Notes/_blackbox.mdx diff --git a/src/components/Notes/_experimental.mdx b/src/components/Notes/_experimental.mdx new file mode 100644 index 0000000..da1b082 --- /dev/null +++ b/src/components/Notes/_experimental.mdx @@ -0,0 +1,6 @@ +:::caution + +This feature is experimental. You should expect it to change in future versions, +cause unexpected behavior, or simply not work at all. + +::: diff --git a/versioned_docs/version-0.10.5/language_concepts/data_types/05_slices.md b/versioned_docs/version-0.10.5/language_concepts/data_types/05_slices.md index b506d13..bc7f5c5 100644 --- a/versioned_docs/version-0.10.5/language_concepts/data_types/05_slices.md +++ b/versioned_docs/version-0.10.5/language_concepts/data_types/05_slices.md @@ -12,6 +12,12 @@ keywords: ] --- +:::caution + +This feature is experimental. You should expect it to change in future versions, +cause unexpected behavior, or simply not work at all. + +::: A slice is a dynamically-sized view into a sequence of elements. They can be resized at runtime, but because they don't own the data, they cannot be returned from a circuit. You can treat slices as arrays without a constrained size. diff --git a/versioned_docs/version-0.10.5/language_concepts/data_types/06_vectors.md b/versioned_docs/version-0.10.5/language_concepts/data_types/06_vectors.md index ec8a4cc..c5b74c8 100644 --- a/versioned_docs/version-0.10.5/language_concepts/data_types/06_vectors.md +++ b/versioned_docs/version-0.10.5/language_concepts/data_types/06_vectors.md @@ -12,6 +12,13 @@ keywords: ] --- +:::caution + +This feature is experimental. You should expect it to change in future versions, +cause unexpected behavior, or simply not work at all. + +::: + A vector is a collection type similar to Rust's Vector type. It's convenient way to use slices as mutable arrays. Example: diff --git a/versioned_docs/version-0.9.0/language_concepts/00_data_types.md b/versioned_docs/version-0.9.0/language_concepts/00_data_types.md index f41b38e..abbadca 100644 --- a/versioned_docs/version-0.9.0/language_concepts/00_data_types.md +++ b/versioned_docs/version-0.9.0/language_concepts/00_data_types.md @@ -210,6 +210,13 @@ You can create arrays of primitive types or structs. There is not yet support fo ### Slices +:::caution + +This feature is experimental. You should expect it to change in future versions, +cause unexpected behavior, or simply not work at all. + +::: + A slice is a dynamically-sized view into a sequence of elements. They can be resized at runtime, but because they don't own the data, they cannot be returned from a circuit. You can treat slices as arrays without a constrained size. Slices are part of the [noir standard library](../standard_library/slice_methods) so you need to import the respective module in order to work with it. For example: @@ -227,6 +234,13 @@ fn main() -> pub Field { ### Vectors +:::caution + +This feature is experimental. You should expect it to change in future versions, +cause unexpected behavior, or simply not work at all. + +::: + A vector is a collection type similar to Rust's Vector type. It's convenient way to use slices as mutable arrays. Example: