4 ms·
Could you elaborate what is not compositional about it? I always thought one of the biggest attractions of anything point-free is its compositionality (from whi
by Aardappel 8y ago
Could you elaborate what is not compositional about it? I always thought one of the biggest attractions of anything point-free is its compositionality (from which follows easy refactorability).
- evincarofautumn 8y agoComposition lends itself to point-free code, but not all point-free code is built from composition. By “it’s not compositional” I mean a few things: 1. Tacit programming in APL-family languages is very much about application of functions to arguments, not function composition; it’s just that the arguments can be made implicit in various ways, e.g., forks & hooks in J. 2. You can’t always extract a subexpression verbatim into a definition and have it work the same way, for example because you need to disambiguate whether a verb is being used monadically or dyadically. 3. Conversely, you can’t always do evaluation by just substituting the definition of a word into an expression where that word is used. How an expression is parsed depends on the types (well, parts of speech—noun, verb, adverb) of intermediate results and the context of the sentence. Part of the reason for all this complexity is just that the language tries to be purely function-level (à la Backus’s “Can Programming Be Liberated from the Von Neumann Style?”), but not all terms denote functions. That’s why I prefer concatenative programming languages—they’re much simpler in structure because all terms do denote functions and your program is just a flattened dataflow graph (typically a post-order traversal).
- tluyben2 8y ago> I prefer concatenative programming languages I can see that point. Concatenative languages are languages people also (like APL/k/j) cry about when they see code in it; they are usually terse as well (words are usually kept short) which is indeed why I like it. When I encounter a new board, I first port a Forth.