Skip to content

New AST + compile time support + generate pure nim procs

Compare
Choose a tag to compare
@HugoGranstrom HugoGranstrom released this 18 Aug 18:56
· 34 commits to master since this release

The AST has gotten an overhaul to be able to run at both runtime and compiletime. It should now be on par with the old AST plus a bit more.

It has also gotten the ability to generate fast pure nim procs from symbolic expressions. The symbolic expression sin(x*y^2) gets transformed into a proc like proc f(x, y: float): float = sin(x*pow(y, 2)).

Also the extensibility of the library have improved. For example custom mathematical functions can be generated using the registerSymFunc template which you get access to by importing symbolicnim/backend. For examples see exp, ln, sin, cos, tan in deepEmbeddings.nim.

In addition to this, custom types that contains symbolic expressions can also be compiled if provided a compile macro. A proof of concept SymMatrix type has been created that generates an Arraymancer Tensor when compiled.