Skip to content

Styleguide

This file contains the official style guide for the I-programming language.

I-Language

File/Module Docstrings

The file should contain a docstring at the top, formatted like this:

main.il
1
2
3
4
5
6
7
/*
{SHORT DESCRIPTION}
{VERSION}

[{AUTHOR}]
{LICENSE TEXT}
*/

This is just a recommendation and used in all I-language files. There should be one space below them before the next section.

Import statements

The import statements should be in the simplest form:

main.il
import MODULE;

or

main.il
import MODULE from PACKAGE;

Custom namespaces are allowed but should be used rarely.

Sections

Sections can be separated by following comments with two empty lines above, and one below them.

main.il
1
2
3
//////////
// NAME //
//////////

Variables

Variables should be separated from constants, above them. They should be lowercase, with underscores as separators.

main.il
type NAME = VALUE;

Constants

Constants should be in uppercase letters.

main.il
const NAME = VALUE;

or

main.il
const type NAME = VALUE;

Last update: 2024-02-14