Skip to content
Andrew Johnson edited this page Jan 8, 2025 · 3 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.

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.

Library Naming Conventions

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