Skip to content

feat: expose public Haskell APIs through C and Python - #72

Merged
LunaStev merged 3 commits into
wavefnd:masterfrom
LunaStev:feat/full-language-bindings
Nov 2, 2026
Merged

LunaStev merged 3 commits into
wavefnd:masterfrom
LunaStev:feat/full-language-bindings

Conversation

@LunaStev

@LunaStev LunaStev commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Expose the existing public Haskell APIs through C and Python, including typed mathematical objects, callbacks, mutable storage and file interchange. The wrappers call the original implementations and retain their numerical behavior, errors and type constraints.

Changes

  • Map all 3,316 inventoried public source symbols to explicit C/Python interfaces. Document concrete supported instances; arbitrary user-defined Haskell typeclass instances still require compiled adapters.
  • Add bindings across algebra, matrices and decompositions, polynomials, numerical solvers, autodiff and optimization, tensors, neural layers, machine learning, statistics, graphs, geometry, images, spectral operations, collections and interchange.
  • Add FP32/FP64 borrowed-buffer GEMM with configurable limits and optimized providers. Preserve exact integers/rationals and supported complex, bounded and nested numeric types.
  • Specify ownership, callback lifetimes, overlap rules, threading, conversion and NaN/Inf policies. Preserve structured MathError, expression and interchange error payloads across callbacks.
  • Extend the documentation site with domain references, signatures, original-source links and executable examples.
  • Prepare a relocatable C/C++ SDK, self-contained Python distributions and a Cabal source package. Manual publication consumes a verified immutable candidate, checks existing hashes and stages GitHub assets before package uploads.

Validation

  • 128 integration checks passed, including independent original-Haskell comparisons and C/C++/Python contracts.
  • 3,747 numeric comparisons plus all 12 optimizer sequences also passed against the debug build. The oracle matches the native build's optimization level while keeping its fixture driver unoptimized.
  • Fresh Haddock inventory: 3,316/3,316 source symbols mapped; ABI epoch 1, 3,826 exported symbols and SONAME verified.
  • Strict documentation build: 401 HTML pages with valid local links and anchors; Python documentation examples execute successfully.
  • Actual repaired manylinux wheel installs and passes contracts, NumPy/DLPack and cffi checks on clean Python 3.9 and 3.14 containers without GHC or native-library overrides.
  • Relocated SDK passes C/C++, pkg-config and CMake clients without a system GHC installation.
  • Actual Cabal source archive passes offline lib:hmath and flib:hmath builds with -O0 -Wall -Werror. Python source-distribution native rebuild also passed.

Release scope

Package metadata is updated consistently to 1.1.0 across Python, Cabal, Meson and the native version query. README is unchanged. This PR does not publish packages or create a release; publication remains a separate manual workflow. CI installs pinned Ruff and clang-format versions before checking generated bindings. Hackage uses the HACKAGE_TOKEN secret in the pypi environment.

@LunaStev
LunaStev merged commit 7b8520f into wavefnd:master Nov 2, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant