Developer ports decimal.js to Go in 72 hours, uncovers 2 bugs in original library
A solo developer ported decimal.js, a JavaScript arbitrary-precision arithmetic library, to Go during a 72-hour hackathon called Port Mortem 2026. The project involved replicating over 20 mathematical operations including trigonometry, transcendental functions, and nine rounding modes with zero dependencies. Rather than correcting errors, the developer prioritized behavioral parity, arguing that downstream users depend on the original library's exact output, including its quirks. To verify accuracy, a cross-validation harness was built that ran 1,518 test cases through both implementations, achieving byte-for-byte identical results. The process ultimately revealed three bugs in the Go port and two genuine upstream bugs in the original decimal.js library, discovered through differential fuzzing.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in