Version 1.5 is now available! See Releases for more information.

Loci is a multi-paradigm systems programming language. Or, to describe it in a slightly more intuitive way, it’s very similar to, and a close competitor of, C++.

It’s a language that aims to not only fix many of the problems that plague C++, but also to introduce whole new paradigms and programming styles that are extremely useful for developers. Alongside that, of course, the language aims to have no performance overhead versus C and C++.

Before going further, here’s some example code:

class ExampleClass(int a, int b) { // Constructor with default implementation. static create = default; int getA() const noexcept { return @a; } int getB() const noexcept { return @b; } } interface ExampleInterface { int getA() const; } void printA(const ExampleInterface& examplePoly) { printf(C"A equals %d.", examplePoly.getA()); } int main() { auto exampleInst = ExampleClass(1, 2); printA(exampleInst); return 0; }

The output is:

A equals 1.

So hopefully the first thing that strikes you is that the language shares the look and feel of C++. On the other hand you’ll also notice differences that are designed to enhance the development experience, such as Structural Typing, which allows a class instance to be casted to an interface instance as long as the class provides all the methods required by the interface.

This means the end of explicit declarations of polymorphic inheritance, which can be particularly valuable if you’re hoping to create an interface after the classes that implement it have already been written (or, e.g. are in the standard library). Note there’s almost always no performance penalty for this feature.