
Man or boy test - lisper
https://en.wikipedia.org/wiki/Man_or_boy_test
======
jdkee
I am about a third of the way through Knuth’s Art of Computer Programming. It
is an amazing piece of work created by one man. The sheer breadth and level of
complexity in the work is awe inspiring. I wish my younger self had read a
copy when learning 6502 assembly in the 80s simply to understand data
(information) structures.

That said, this procedure is a doozy. It reminds me of the Ackermann function
but doesn't quite grow as fast (understatement).

~~~
lisper
If you like the Ackerman function you're gonna love Kruskal's tree theorem.

[https://en.wikipedia.org/wiki/Kruskal%27s_tree_theorem](https://en.wikipedia.org/wiki/Kruskal%27s_tree_theorem)

~~~
fossuser
This essay is also great if you like this kind of thing:
[https://www.scottaaronson.com/writings/bignumbers.html](https://www.scottaaronson.com/writings/bignumbers.html)

~~~
danbruc
Or this page [1] on large numbers.

[1]
[https://mrob.com/pub/math/largenum.html](https://mrob.com/pub/math/largenum.html)

------
acqq
The RosettaCode versions:

[http://rosettacode.org/wiki/Man_or_boy_test](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"

~~~
ufo
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?

~~~
kps
Call by name.

~~~
ufo
Do you know if there a way to specify that a parameter should be passed using
call-by-value?

~~~
kps
Function parameters can be declared ‘value’.

------
bryanrasmussen
When I saw the title I thought, huh, maybe it's that thing were old prisoners
threaten the young ones to see who's easy prey but no - it's a test in Algo 60
to see what compilers correctly implement recursion.

~~~
TeMPOraL
I thought it was going to be about rituals present in many cultures around the
world (especially before contact with modern technological civilization) - the
rites of passage from childhood to adulthood.

~~~
mikekchar
I was interested to know if I thought I could pass such a ritual. And then I
was interested to know if I thought it was important for me to pass :-) Not
sure I know the answer to that last one!

~~~
TeMPOraL
I think the answer to the last one depends on your social circle :). Rites of
passage are group membership rituals. There's no point in doing the movements
and sacrifices if there's no group you wish to enter that uses it as a
condition of membership.

~~~
mikekchar
This is a super good point. I keep going on about how in Japan (where I live)
it is super important to be willing to do the things that are required when
trying to move to an in-group. You can't generally pick and choose ("I'll
follow the rules that makes sense to me" doesn't fly here). So, you have put
your finger on it. I would definitely do that if I valued the in-group I was
trying to move to.

~~~
RugnirViking
You seem to be under the impression that somebody would say "I'll follow the
rules that make sense to me" when entering a new group and suffer no negative
social concequences in other societies.

I really don't think picking and choosing which rules you follow would be
appreciated anywhere.

------
JetSetWilly
Of course it is in the Online Encyclopedia of Integer Sequences:
[https://oeis.org/A132343](https://oeis.org/A132343)

------
mcguire
Knuth also wrote the "trip" and "trap" suites for TeX and MetaFont
conformance.

[https://texfaq.org/FAQ-triptrap](https://texfaq.org/FAQ-triptrap)

------
HNLurker2
...and girls from gals

