Skip to main content
Version: v0.36.0

Comments

A comment is a line in your codebase which the compiler ignores, however it can be read by programmers.

Here is a single line comment:

// This is a comment and is ignored

// is used to tell the compiler to ignore the rest of the line.

Noir also supports multi-line block comments. Start a block comment with /* and end the block with */.

Noir does not natively support doc comments. You may be able to use Rust doc comments in your code to leverage some Rust documentation build tools with Noir code.

/*
This is a block comment describing a complex function.
*/
fn main(x : Field, y : pub Field) {
assert(x != y);
}