Search code examples
functional-programmingtheoryjapl

what's the motivation for J to introduce fork


For the evolution from APL to J, What's the motivation to introduce fork? I guess it is nice to have (+/ % #) for calculating the average, but it also makes it harder to read longer verb train. Facing this tradeoff, is there any compelling reason for the APL inventor to choose this style in J?


Solution

  • Thanks for Bob's answer. To make it stronger, now I learned that the necessity of fork as below.

    • The motivation of introducing fork is to implement tacit programming as a realization of Combinatory logic. you need sort of basis combinators for this ( like the s-k basis on wiki) , and hook/fork form a complete basis. Fork or its equivalent is really unavoidable for this purpose.

    • the concept of fork is natural if thinking of f + g, f * g. In math they usually mean f(x) + g(x) and f(x) * g(x).

    • This topic was explained nicely in Roger Hui's essay on verb trains.