Releases: DevKiDCosmo/Moo
0.1.23-alpha
Moo Library Release Notes
Version 0.1.23-alpha (2025-07-07)
Overview
Moo (もう) is a universal source-of-truth mathematical library, providing high-performance, precise mathematical operations across multiple programming languages via a native DLL/SO interface. This release includes extensive API coverage, unified behavior across platforms, and multi-language support.
✨ New Features
-
Multi-language API Bindings:
- Python (api/python/moo.py): Full API coverage, auto-loads the correct shared object depending on platform (
.dll,.so,.dylib). - Java (api/java/moo.java): Uses JNA for native access.
- Rust (api/rust/moo.rs): Loads shared object at runtime using
libloading. - Go (api/go/moo.go): Uses cgo for direct access.
- Lua (api/lua/moo.lua): Uses LuaJIT FFI for seamless native calls.
- .NET/C# (api/cs/moo.cs): P/Invoke interface for all DLL exports.
- Python (api/python/moo.py): Full API coverage, auto-loads the correct shared object depending on platform (
-
Universal Mathematical API:
- Arithmetic:
absolute,min,max - Division:
idiv,mod,flmod - Integer Math:
gcd,lcm - Factorials & Binomials:
fac,binom,factable,clearptr - Permutations & Combinations:
permutation,combination,genPerm,freeptr - Rounding:
dfloor,dceil,round,roundk - Advanced Math:
pow,fpow,sqrt,ksqrt,exp,ln,log - All APIs are standardized and listed in
docs/api.mdandapi/sot.api.json.
- Arithmetic:
-
Memory Management
- Functions returning pointer arrays (e.g.,
factable,genPerm) always provide a corresponding cleanup function (clearptr,freeptr), ensuring no memory leaks and safe cross-language use.
- Functions returning pointer arrays (e.g.,
🛠️ Improvements / Changes
-
API Standardization
All APIs now follow the universalsot.api.jsondefinition, ensuring consistent signatures, error handling, and memory rules across languages. -
Cross-platform Build System
- Windows: CMake, MSVC, and Meson builds are tested and produce
Moo.dll. - Linux & MacOS: CMake and Meson builds produce
libMoo.so/libMoo.dylib. - Continuous Integration: Full matrix build for Windows, Linux (Debian, Ubuntu, Alpine, Fedora, etc.), and MacOS.
See.github/workflows/compiling.yml.
- Windows: CMake, MSVC, and Meson builds are tested and produce
-
Documentation Unified
- All supported language APIs are documented in
docs/api.md. - API reference source-of-truth is
api/sot.api.json. - Basic operations, advanced mathematical function call mappings, and draft notes for future features are now available in the
docs/folder.
- All supported language APIs are documented in
🐛 Bug Fixes
-
Memory Safety
- Fixed: All pointer-returning functions (like
factableandgenPerm) must be cleaned up by the caller using the provided API (clearptr/freeptr). All bindings enforce this, preventing memory leaks. - Fixed: Edge-cases in
factableandgenPermnow properly returnnullptror raise an error if parameters are out-of-range or allocation fails.
- Fixed: All pointer-returning functions (like
-
Mathematical Correctness
- Fixed:
gcd,lcm,modfunctions now handle zero and negative values correctly. - Fixed:
pow/fpowfunctions handle integer and floating point exponents accurately, with fallback to exponential/logarithmic evaluation as needed. - Fixed:
flmodandmodboth now provide correct results for negative operands (see docs/basics.md).
- Fixed:
-
Cross-Platform / API Edge Cases
- Fixed: Floating point rounding functions (
round,roundk) now behave consistently across platforms. - Fixed: All APIs now check argument ranges (e.g.,
genPermlimited ton <= 12to prevent excessive memory allocation). - Fixed: DLL/SO function name conflicts (e.g.,
dceil/dfloorinstead ofceil/floor) resolved to avoid collisions with standard libraries.
- Fixed: Floating point rounding functions (
-
Build System
- Fixed: CMake, Meson, and CI scripts now support all major platforms and compilers, including proper artifact upload for all variants.
📝 Known Issues & Limitations
-
API Coverage:
- Trigonometric, hyperbolic, advanced number theory, and matrix operations are planned but not yet implemented.
- Some mathematical operations (prime factorization, CRT, Bernoulli/binomial distribution, etc.) are still in draft or not implemented.
-
Permutations:
genPerm(n)is limited ton <= 12to avoid excessive memory usage (due to factorial growth).
-
Documentation:
- Some language bindings are still in draft or marked as TODO in the docs.
-
Error Handling:
- Most APIs signal errors via
nullptr/NULLpointers or return values; language bindings throw exceptions or return errors accordingly.
- Most APIs signal errors via
📦 Files and Structure
api/— All language bindingssrc/— C++ core implementation and headersdocs/— Documentation and drafts.github/workflows/— CI/CD scripts for build/test on all platforms
🚀 Getting Started
- Build or download the appropriate shared library (
Moo.dll,libMoo.so,libMoo.dylib) for your platform. - Copy the relevant API binding for your language from
/api/. - See
docs/api.mdfor example usage and API reference.
📜 Full Changelog
Major Changes
- First stable cross-platform release with multi-language support.
- Unified API reference and behavior.
- Extensive build/test matrix ensures reliability on Windows, Linux, and MacOS.
Minor Updates
- Improved documentation for all APIs and math functions.
- Added error checks and range limitations for all pointer-returning APIs.
- Refactored all math routines for correctness and platform independence.
🌱 Upcoming / Planned
- Trigonometric and hyperbolic functions
- Advanced number theory (primality, CRT, modular inverses)
- Matrix operations and systems of equations
- High-precision arithmetic
- Symbolic math and parser/grammar support
- More language bindings (Delphi, Pascal, D, Nim, Julia, Haskell, Ruby, R, Perl, Swift, OCaml, V, Zig, etc.)
💖 Thanks
Thanks to all contributors and testers for helping shape Moo into a universal math library for all developers!
0.1.7-Alpha+229a
Supported APIs for Lua, Python, Rust, C#, Plain Dll, Go and Java. All features can be seen in here. In future more APIs should be added to the supported list and more function will be added.