It is not only asymptotically faster than Java Script, Scheme, Haskell or any other language that has lambdas, as explained on my previous post, but it is also actually efficient: we’re reaching 150m rewrites/s in a GTX 1080 with a massively parallel Open CL implementation, which makes it faster than GHC even for “normal” programs. If you wanna hear more about this, feel free to follow me on Twitter.
Finally, it has a clear cost model, which makes it well suited as the foundation of a decentralized VM; a functional counterpart of the EVM. There are two reasonable answers: either we copy the superposition, which may lead to a super-superposition, or we undo the superposition, moving each superposed value to each target location. It is quite dead right now, but I’ll be using it whenever I have something new to show off.
This allows two optimizations: first, the λ can keep a pointer to the occurrence of its variable, so, there’s no need for a traversal.
Second, since the variable only occurs once, we can merely redirect the reference of (λp.
Finally, I’ll hint a direct isomorphism between the SIC and Symmetric Interaction Combinators, rendering the former as a mere textual interpretation of the later. That is, it is impossible to duplicate a duplication.
If you want a short specification and explanation, check out the Rust implementation. To make it more powerful, we could just extend definitions and superpositions with labels.The proposal is to use the algorithm without an oracle (i.e., incomplete, but efficient), and restrict our term language to only be able to express terms that are compatible with it. The most promising way to do it is to shift to a different underlying logic: Elementary Affine Logic, which essentially stratifies terms in “layers”, preventing a term to duplicate another term in the same level, making it Absal-compatible. This proposal is particularly interesting because of its nice normalization properties. EAL is not only strongly normalizing, but its complexity is predictable, even for the untyped language. Because of that, a type theory based on EAL could even have type-level recursion without becoming inconsistent! It requires programmers to write explicit duplications with very unfamiliar restrictions. As an illustration, here is addition in EAL Calculus of Constructions: As you can see, the later is much simpler. At this point, you may be asking why, to which I reply, why do we even had a scope to begin with? So, extending the Abstract Algorithm to cover all lambda terms ruins its efficiency, and restricting the λ-calculus to be Absal-compatible makes it hard to program with. For one, we know there are things λ-terms can do that Absal can’t. c) 2 3)--------------------------- lambda applicationλt. One may argue adding it is an arbitrary, artificial limitation. Either we give up of lambdas, duplications, constant-time operations or closed scopes. But the converse is also true: there are things Absal can do that λ-terms can’t! In any case, there seems to be no other way: see this S. To have the first 3, closed scopes must be abandoned. In a sense, it is more powerful than the λ-calculus, because applications can move arguments to outside the function’s scope. For example, it has no problems expressing abstractions whose variables occur outside of their own bodies, which makes no sense on the λ-calculus. c) 1 2 3)--------------------------------- lambda applicationλt. Yet, it is much less powerful, because of the lack of duplication. The problem here is that, after copying a λ, the “same” bound variable will exist in two different places, but its occurrence remains in a single place. That is, since a duplication allows one lambda to be in two places at the same time, then we need a way to store two variables in one place at the same time. That sounds like a reasonable solution, but doing so requires extending the graphical representation of λ-terms with new nodes and reduction rules; the so-called “oracle”. As it turns out, after decades of research, nobody figured out an efficient oracle. term)----------------------------- lambda copyterm = (f0 & f1) (x0 & x1)λt.