Monorepo for @tsci/sym — a SymPy-style symbolic mathematics library for JavaScript.
| Directory | Description |
|---|---|
package/ |
The @tsci/sym npm package |
example/ |
React + Vite demo app |
sympy/ |
SymPy Python source, kept locally as an algorithmic reference |
Requires Bun.
bun install # install all workspace dependenciescd package
bun run build # tsc + boperate validate
bun run test # run testscd example
bun run dev # Vite dev server
bun run build # production buildThe library is an expression tree CAS (computer algebra system). Each node (Add, Mul, Pow, etc.) extends the abstract Expr base class defined in package/src/Expr.ts. The boperators transform rewrites native operators (+, *, **, etc.) into calls to static methods on Expr subclasses at build time.
Key directories under package/src/:
| Directory | Contents |
|---|---|
core/ |
Sym, Num, Rational, Add, Mul, Neg, Pow |
functions/ |
Sin, Cos, Tan, Asin, Acos, Atan, Log, Abs |
constants/ |
Pi, E, I |
utilities/ |
diff, integrate, solve, subs, evalf, sqrt, log |
bun run check # Biome lint
bun run format # Biome format