Contributors · Internals

Codebase map

The source tree is easier to read once you separate the symbolic core, the mathematical domains, and the public subpath façades. Most debugging starts by identifying which of those layers owns the behavior you are seeing.

The top-level directories

core/

The symbolic object model and shared machinery: parser, expressions, equations, vectors, matrices, rationals, converters, settings, errors, dispatch, and core helper functions.

algebra/

Factoring, simplification, GCD/LCM, partial fractions, polynomial conversion, Gröbner work, and supporting algebraic algorithms.

calculus/

Differentiation, integration, limits, Laplace transforms, and calculus-specific helpers and tables.

math/

Common mathematical functions, special functions, trigonometry, geometry, truncation, and numerical helpers used by notation and algorithms.

solve/

Equation solving, systems, solver classes, root handling, and SolutionSet.

api/

Public subpath entry files such as nerdamer/algebra, nerdamer/calculus, nerdamer/parser, and nerdamer/structures. These expose selected source functionality; they are not the implementation domains themselves.

utils/

Reusable lower-level utilities shared across the implementation, including debugging helpers.

index.ts

The full-package entry point. It assembles the modules, exports the callable Nerdamer API, and attaches selected higher-level operations to core classes.

A useful way to read src/core

src/core/
├─ classes/
│  ├─ expression/      central symbolic scalar representation
│  ├─ parser/          tokenization, RPN, operators, scripting
│  ├─ equation/        LHS/RHS equation structure
│  ├─ rational/        exact rational arithmetic
│  ├─ vector/          ordered aggregate + vector operations
│  ├─ matrix/          matrix representation and operations
│  ├─ valuesSet/       finite set semantics
│  └─ ...
├─ converters/         text and TeX conversion
├─ functions/          shared symbolic functions
├─ dispatch.ts         parser-visible function registry
├─ Settings.ts         shared parser/engine settings
├─ errors.ts           typed errors and messages
└─ types.ts            ExpressionInput, NerdamerInput, ParserEntity

Implementation directories are not the same as import paths

A newcomer can easily confuse src/algebra with the package subpath nerdamer/algebra. The first contains implementation code. The second is assembled through a small façade in src/api/algebra.ts that exports the supported API for consumers.

Implementationsrc/algebra/

Algorithms and internal supporting code.

Façadesrc/api/algebra.ts

Selects what the package subpath exposes.

User importimport { factor } from 'nerdamer/algebra'

The supported package-facing entry point.

Follow the data, not just the imports

Many features cross module boundaries. A solver may call algebra helpers; calculus works on the same Expression representation as factoring; a parser-visible function may be registered in dispatch.ts but implemented in another domain. When tracing behavior, identify the object being passed between layers and follow that object.

Browse the source tree

The current src directory is the authoritative map for implementation ownership.

nerdamer/src
Understand the object being passed

Read the expression model next if the representation itself is still unfamiliar.

Expression model