HLML

Click here to access the GitHub repo.

HLML stands for “High Level Maths Library” and is an auto-generated maths library for C and C++.

Traditionally maths libraries for C++ use templates to define a base vector and matrix type, but this comes with several issues:

So HLML generates all of its maths types via a separate program for types bool, int, uint, float, and double. The code is far easier to read and debug and is capable of supporting case-specific optimisations.

The idea of using a generator comes from Unity.Mathematics but that’s for C#. I wanted to do, more or less, the same thing but for C/C++.

There’s also a very barebones and minimal SIMD API which is still in development, but is capable of producing fully optimised assembly with no aliasing.

The generator codebase itself can get verbose in places but ultimately the actual API (which is the main aspect of the software) is a joy to use and runs very fast.