Gleam allows you to write comments in your code.

Here’s a simple comment:

// Hello, world!

In Gleam, comments must start with two slashes and continue until the end of the line. For comments that extend beyond a single line, you’ll need to include // on each line, like this:

// Hello, world! I have a lot to say, so much that it will take multiple
// lines of text. Therefore, I will start each line with // to denote it
// as part of a multi-line comment.

Comments can also be placed at the end of lines containing code:

pub fn add(x, y) {
  x + y // here we are adding two values together

Comments may also be indented:

pub fn multiply(x, y) {
  // here we are multiplying x by y
  x * y