4 comments

  • hshdhdhehd 13 hours ago ago
  • diegoofernandez 17 hours ago ago

    Author here. The journey from fractions to Gröbner in 3 months was brutal but enlightening.

    Technical insights for the HN crowd: - Optimized pair selection beats naive Buchberger by 40% - AST memory pooling handles 7-variable polynomial explosion - BigInt precision eliminates numerical stability concerns

    For enterprise folks: This solves the "last-mile" problem of mathematical optimization - accessible tools for domain experts.

    The 7-variable limit isn't a bug, it's a feature - covers 80% of real business constraints while staying performant.

    Demo is live at the link. Code architecture questions welcome.

    • keepamovin 11 hours ago ago

      I didn't look into the code, but what language did you use? Something to WASM? Or just JS? Or a backend? Also how do you model the symbolic terms?

      • diegoofernandez 8 hours ago ago

        Hi! Thanks for the excellent questions. It shows you're looking past the demo and into the core architecture.

        Language / Platform: The entire Romimath core engine is built purely in TypeScript, compiled directly to JavaScript (ES6+). It runs 100% client-side in the browser (as you see in the demo) to perform the heavy symbolic computation. We specifically avoided WASM for the core math to ensure maximum portability and maintainability within the JavaScript ecosystem, while still achieving extremely high performance (solving the 4D complex system in approx 2 seconds).

        2. Symbolic Terms Modeling: This is the most critical part, as it ensures the engine's precision:

        Custom AST and BigInt: We use a custom, modular Abstract Syntax Tree (AST) to model polynomials. All coefficients are handled using native JavaScript BigInt and our custom Rational Number class. This is non-negotiable, as it ensures infinite precision and eliminates floating-point error throughout the entire computation.

        Buchberger's Pairs (P_i, P_j): These pairs drive the algorithm's progress. For each pair, we: 1. Compute the S-polynomial (cancel leading terms) 2. Reduce it against the current basis 3. Add non-zero remainders as new constraints

        The speed you see comes from optimized pair selection - we skip pairs where leading terms are relatively prime (gcd=1), as they're guaranteed to reduce to zero. This avoids unnecessary computations while ensuring mathematical correctness.

        The value proposition is simple: Romimath is a full-stack algebraic engine that combines the portability of TypeScript with the mathematical certainty of BigInt for complex symbolic computation running entirely in the browser.

        Thanks for checking it out!