Tour: Basics

By default, input characters are processed as content. The “#” character starts a comment, with all following characters up to and including the following line ending being part of the comment. If the last non-whitespace character of a comment is another “#” (i.e. not the initial one), the line ending is excluded from the comment.

A command character introduces non-content structures. By default, the only command character is the backslash “\”. You can escape non-alphanumeric characters with a command character.

Empty lines separate paragraphs. If a paragraph does not produce any output, it will be removed after evaluation. You can use paragraphs to cleanly separate code like declarations or assignments from code that produces output.

Details

Nyarna works on Unicode input. The reference implementation currently only accepts UTF-8 encoded input.

The space U+0020 and tabular U+0009 character are inline whitespace. The carriage return U+000D, line feed U+000A, or both in sequence, are a line ending. A line ending is always processed as if it was a single line feed.

Inline whitespace in front of a comment or a line ending is always ignored. This allows you to write end-of-line comments without adding whitespace content to your input, and prevents fully invisible characters to influence your output.

Lines that contain nothing but whitespace are considered empty. If one or more empty lines occur between non-empty lines on the same syntactical level, they are a paragraph separator and include the line ending from the preceding non-empty line.