shu--hung
2021-12-28 15:47:29

I came across this program. It uses delay and force to compute a large unary number. Interestingly, Racket BC used much more memory than Racket CS to the point that I had to kill it or it would have exhausted my laptop’s memory. https://stackoverflow.com/questions/70501342/how-to-use-of-laziness-in-scheme-efficiently Changing the delay/force pattern to lazy (https://docs.racket-lang.org/reference/Delayed_Evaluation.html#%28form._%28%28lib._racket%2Fpromise..rkt%29._lazy%29%29 from SRFI–45) reduces the memory footprint, but Racket CS is still faster and uses less memory than Racket BC.