News for hackers. Stuff that matters.
Re:Man or boy test by acqq on Thursday November 28, 2019 @05:10AM (#21656004)
The RosettaCode versions:

http://rosettacode.org/wiki/Man_or_boy_test

"Haskell

Haskell is a pure language, so the impure effects of updating k must be wrapped in the IO or ST monad (...)

On an AMD Opteron 6282 SE (1) using GHC 7.8.2 this program can compute k = 30 in 1064 s and 156.2 GiB. (2)"

"JavaScript

In Chrome we get a "Maximum call stack size exceeded" when a > 13. In Firefox we get "too much recursion" when a > 12." (Note: it should say "k" (the parameter) not "a").

---

1) 16 cores.

2) 156 GB of RAM: "159874 MB total memory in use"

Re:Man or boy test by ufo on Thursday November 28, 2019 @08:36AM (#21657195)
I'm not super familiar with Algol but it seems that this function is not using call-by-value? In most of the translations the parameters to A are functions instead of reals.

Is this call by name or call by reference? And how would call by value look like in Algol?

Re:Man or boy test by kps on Thursday November 28, 2019 @12:33PM (#21658938)
Call by name.
Re:Man or boy test by ufo on Thursday November 28, 2019 @05:37PM (#21660629)
Do you know if there a way to specify that a parameter should be passed using call-by-value?
Re:Man or boy test by kps on Thursday November 28, 2019 @06:27PM (#21660848)
Function parameters can be declared ‘value’.