Rho Calculus and Reactive Computing

Emulating reactive biological processes and AI

Previous article on AI Automation of Software can be found here

Reactive Computing

Reactive computing and artificial intelligence are popular post von Neumann computing models influenced by how a nerve cell (neuron) works:

When I say post von Neumann, I mean specifically the lack of a traditional clock to coordinate the computation. Rather, the clock has been replaced by input “triggers” that remain inert until certain conditions arise. In a neuron, these are called dendrites. The nucleus of the cell has logic that reads the dendrites for certain inputs and then decides to “fire” — represented by the axon — resulting in state changes to axon terminals that are in turn sensed by other dendrites:

Signal processing the natural way

This means the neuron exhibits duality of containing both processing logic (“code”) in the nucleus and state (“data”) in the axon terminals. This curious duality of code/data is a common theme in next generation computing systems.

In this way, we also see how the AI industry is segmented into the “data sciences” portion e.g. deciding when dendrites fire the input guard - and the “automation” portion e.g. how axons are arranged to fire events and update state:

We need to make this distinction because a lot of data sciences outfits (essentially old fashioned analytics) have rebranded themselves as AI without considering automation.

Rho the Reactive Calculus?

If we return to the rho calculus, we see the same input and output structures, plus the ability to compose them:

As the flow-based programming crowd knows, the devil is in the implementation. Neurons can have potentially non-trivial logic: consider a process that is waiting on two voltage inputs A and B.

Unfortunately let’s say input B is a square wave that continually oscillates between 0 and 1:

Input B is mostly noise

If we want A AND B , we want to ignore input B until input A goes high. But what if the logic is A OR B ? Then the oscillation must be transferred along. Ideally, we project the state of B down to the next neuron and so on until the point of use. Because the bulk of B’s signals is really noise, we want to avoid running any code, stuffing anything in queues etc. whenever B changes. In SQL terminology, we would be stacking ‘views’. In Excel, we pass cell contents along. In rho terminology, this is the job of “reduction” — we are squeezing together all the intermediate neurons and filtering out noise. We simply want to make sure whoever ultimately consumes the value of B is “looking” at the right place when the time comes.

Reactive Surfaces

As Einstein was happy to point out, the act of “looking” at something gets complicated. Axon terminals retain state that can be observed by the dendrites, muscles etc. but also thanks to tricks with physics are not entirely passive. Databases have the handy property of providing surfaces that can also be observed. Traditional programming however lacks much in the way of topology and this is where technologies such as Single-Level Memory can play a role. But the neuron remains the best example of how code can be viewed as data, and the data can behave like code … at the same time.

Soma

Mapping to Hardware

Silicon Valley has been unable to move much past von Neumann machines, so mapping these constructs with traditional programming is awkward. Bottom line, existing chips still requires clocks in order to poll state and memory is somewhere else. In the AI space, this is normally done by FPGA circuits. Even the latest “intelligence” processing units seem to simply move tiny von Neumann machines closer to the memory. Building truly reactive hardware has proven difficult and a lot of research has been concentrated on things like phase change memory. Other work has involved combining voltage (or light) to stimulate a reactive surface, as this is closest to how real neurons work.

Orchestration

Rather, the industry has been accidentally coming at this problem from the opposite end of scale: using entire virtual machines to emulate a single neuron. We are starting to see this with Kubernetes and such constructs as “reactive operators”:

Observed state is truth

Blockchain World

Either way, chips or VMs requires significant hardware investment. This implies only entrenched Big Tech players can play in this space. Even LinkedIn is exploring this arena with DALI. The only alternative is to exploit existing hardware, which is what blockchain is trying to do right?