Ada 99: Rewriting the very first computer program: How does JavaScript stack up?
summary
Rewrites Ada Lovelace’s Bernoulli-number program across two dozen languages using the Akiyama–Tanigawa algorithm implemented in JavaScript, Ada, Pascal, C, Perl, Shell, Forth and even Spectrum Sinclair BASIC. Notes where code needs to change: BASIC lacks recursion so the algorithm is restructured, a PHP fraction library returns wrong values, C forces manual malloc and free and pointer casts, shell arithmetic becomes unreadable, and the Spectrum’s floating-point and 0/0 quirks slow or break results — most implementations ultimately work with language-specific hacks.
AI-written summary · about
