News for hackers. Stuff that matters.
Re:A binary tree of all Pythagorean triples by hakmem on Thursday November 21, 2024 @03:53PM (#42208546)
Yes, this is normal. I am sorry, I am working on a more efficient implementation.

The JavaScript of this page does a lot of number crunching.

It is actually doing arithmetic on the Stern-Brocot tree. It is all written in ClojureScript and not really optimized yet. I mention in the paper that I do not even use TCO.

Anyway, thank you - and all the people here - for the kind words! I am so happy that my article was so well received today.

Re:A binary tree of all Pythagorean triples by akomtu on Thursday November 21, 2024 @03:59PM (#42208591)
A simple trick to solve nearly all freezing problems: move the computations to a background thread, aka Worker in JS terms.
Re:A binary tree of all Pythagorean triples by aabhay on Thursday November 21, 2024 @09:48PM (#42210708)
Another trick — use comlink (https://github.com/GoogleChromeLabs/comlink) to make the worker thread into essentially an async API of your local methods.