Repository navigation
CPM for package management
We have changed how LLVM is pulled in to the project. Previously, this was via a git submodule, but people using git worktrees would see multiple copies of this large library pulled into their workspace, which was slow and unnecessary. The project has been updated to use CPM, which can be configured to pull packages from a cache. By using this, a single version of LLVM will be pulled to the workspace and shared by multiple LLVM build instances. If you build Cmajor from source, and want to take advantage of this caching, you need to set the CPM_SOURCE_CACHE variable. See the README.md for more information about CPM
Changes to C++ generator and integer wrapping
The Cmajor language definition did not clearly define what happened to integers that overflowed (leaving it effectively as Undefined Behaviour). The LLVM backend (used for JIT and WASM builds) wraps overflowing integers, but the C++ backend did not explicitly do this, producing a difference in behaviour between the code paths. We have changed the C++ backend to produce the wrapped behaviour we have with LLVM. This tightening of the implemention is not yet reflected in the language specification. We will revisit this once we are confident this change is correct and doesn't produce performance regression.
Compilation time improvements
The compiler is now smarter when analysing functions when checking source validity, and a previously slow algorithm has been made significantly faster giving large performance gains for some edge cases. For example, the FilterBank example compile time on an M1 mac has dropped from 1.9s to 0.3s
LLVM backend fix
A problem in the LLVM backend that could cause some updates of large data structures passed by value has been resolved. Previously the LLVM optimiser could incorrectly skip some updates, leading to incorrect values being calculated.
Bug fixes
Intrinsics in the C++ generator have been refactored to avoid problems with older C++ compilers
Resolved a problem where the JIT plugin could fail to update it's parameter list when the number of parameters changes
Improved error reporting for some invalid Cmajor code, giving more precise error reporting