Common

From Esolang
Jump to navigation Jump to search

Common (derived from the word comment) is an esoteric programming language in which every part of the program must be written as a comment. As a result, no executable logic can be expressed directly in Common.

History

Common was conceived by heapblk after a discussion with a colleague about another developer’s lack of code comments. During the conversation, the colleague jokingly suggested creating a language where only comments are allowed. This idea led to the design and development of Common.

Syntax

By default, Common uses C/C++ comment syntax:
Line comments:

// this is a line comment

Block comments:

/*
    this is
    a block
    comment
*/

Alternative Comment Styles

Common supports various comment styles through the --parser flag:

Python Style

To use Python-style comments, compile with:

$ common --parser=python filename.txt

This enables:

# Python line comments

and

""" 
Python block comments
"""

PowerShell style

To use PowerShell-style comments, compile with:

$ common --parser=powershell filename.txt

This enables:

# PS line comments

and

<#
    PS block comments
#>

Valid Programs

In Common, any text within comment syntax is a valid program. Since everything must be a comment, the language accepts any content as long as it follows the comment format of the selected style.

File Extensions

Common source files can use any file extension. The compiler will parse any file and generate a corresponding .com output file.