Expand description
Code generation macros for MathHook language bindings and expression construction
This crate provides procedural macros to generate Python (PyO3) and Node.js (NAPI) bindings from a single function definition, eliminating code duplication while maintaining zero-cost abstractions.
Also provides procedural macros for mathematical expression and symbol construction.
§Supported Function Arities
- Unary: sin(x), cos(x), exp(x)
- Binary: pow(x, y), atan2(y, x)
- Variadic: add(args…), mul(args…)
- Constants: pi(), e()
Macros§
- expr
- Procedural macro for creating mathematical expressions with full syntax support
- function
- Procedural macro for creating function expressions
- generate_
nodejs_ binary_ binding - Generate Node.js (NAPI) binding for a binary mathematical function
- generate_
nodejs_ binding - Generate Node.js (NAPI) binding for a unary mathematical function
- generate_
nodejs_ constant_ binding - Generate Node.js (NAPI) binding for a zero-argument constant function
- generate_
nodejs_ variadic_ binding - Generate Node.js (NAPI) binding for a variadic mathematical function
- generate_
python_ binary_ binding - Generate Python (PyO3) binding for a binary mathematical function
- generate_
python_ binding - Generate Python (PyO3) binding for a unary mathematical function
- generate_
python_ constant_ binding - Generate Python (PyO3) binding for a zero-argument constant function
- generate_
python_ variadic_ binding - Generate Python (PyO3) binding for a variadic mathematical function
- symbol
- Procedural macro for creating symbols with optional type specification
- symbols
- Procedural macro for creating multiple symbols at once