Re: Tail call optimization

2025-02-14 Thread Alexander Burger
On Fri, Feb 14, 2025 at 07:30:59AM -0800, Lindsay Lawrence wrote: > On Thu, Feb 13, 2025 at 9:49 PM Lindsay Lawrence < > lawrence.lindsayj...@gmail.com> wrote: > > > > A bit of searching came up with the paper with the haskell version > > > > https://www.cs.ox.ac.uk/people/jeremy.gibbons/publicat

Re: Tail call optimization

2025-02-14 Thread Lindsay Lawrence
> > How about a coroutine version? > > Neat! You have options over what to do with the digits with the coroutine. And negligible difference in performance, if it matters, either. I didn't expect that. /Lindsay : (bench (out "pi-digits.1.txt" (makePi 1))) 3.150 sec -> NIL : (bench (out "pi-dig

Re: Tail call optimization

2025-02-14 Thread Alexander Burger
On Fri, Feb 14, 2025 at 05:21:46PM +0100, Alexander Burger wrote: > Wow, that's cool! I'll measure it now :) The old algorithm needed for 10 digits 8369 sec (02:19 h), the new one (I use the coroutine version) just 726 sec. That's about 12 times as fast! ☺/ A!ex -- UNSUBSCRIBE: mailto:picol

Unsubscribe

2025-02-14 Thread Heiko Henrich
___ Heiko Henrich Kirchenmusik, Jazz und Feldenkrais Britzer Straße 58 12109 Berlin 01522 8776573 heiko.henr...@gmail.com

Re: Tail call optimization

2025-02-14 Thread Lindsay Lawrence
On Thu, Feb 13, 2025 at 9:49 PM Lindsay Lawrence < lawrence.lindsayj...@gmail.com> wrote: > A bit of searching came up with the paper with the haskell version > > https://www.cs.ox.ac.uk/people/jeremy.gibbons/publications/spigot.pdf > > Interestingly enough there is another version of PI in there

Re: Tail call optimization

2025-02-14 Thread Lindsay Lawrence
On Fri, Feb 14, 2025 at 8:58 AM Alexander Burger wrote: > The old algorithm needed for 10 digits 8369 sec (02:19 h), the new > one (I use the coroutine version) just 726 sec. That's about 12 times as > fast! > 👍 👍 :) /Lindsay