Skip to content
Andrew Johnson edited this page Jun 10, 2025 · 6 revisions

There are a few conventions used internally for compiler development and tacitly endorsed for community usage. Some of these are quite unique and may seem foreign or strange.

Library Card System

LM is designed from the ground up to work well with diff based version control mechanisms such as git. A Library Card System is a community development coordination system where each file is only permitted to be checked out by N users at a time. This helps prevent merge conflicts and coordinate development that occurs over shared code fragments.

Index Header Files

An Index is a normal header file that contains only import statements. An Index can be used to group functionality into "packages" despite packages not being an explicit language feature in LM. Examples of Indexes in the compiler would be LIB/default.lm or LIB/default-minimal.lm.

Unit Files

A Unit File is an LM program fragment that defines an individual globally bound term such as a function. If each function definition is given its own separate file then diff version control may work better than otherwise. Proper usage of both the Library Card System and Unit Files will prevent 100% of merge conflicts.

Full Words > Abbreviations

Full descriptive language is preferred over abbreviations whenever possible: TypeContext instead of TContext.

Plural > Singular

Singular noun form is preferred over plural form: mk-thing instead of mk-things.

Simple Present Tense, Base Form

Simple present tense is preferred over other verb tenses: write, read, identify, normalize.

Verbs should not be conjugated for function and method names: sort instead of sorted.

Methods > Functions

Only use functions when a new thing is created; if the thing is being manipulated then use a method.

Constructors

Constructors use functional language naming conventions mk-thing.

Data Structures Are Private

Internal data structures should never be exposed directly through the API.

To Each His Own Convention

LM Core is for compiling code. LM Core is not for enforcing coding standards. There is a plugin system in LM to add additional lint steps; please use these, but don't ask for your convention to become core. If it doesn't affect the meaning of code, then it doesn't belong in core.

Clone this wiki locally