Preface
What is an application? This question is harder than it might seem, but for the purposes of this post we will take an application to be a collection of resource logics (and possibly resources) organized for some holistic purpose, along with read and write interfaces which make sense in the application context.
Applications are not part of the Anoma protocol itself – they must be designed and engineered. How does this happen? I contend that the application development loop as it exists at the moment looks something like the following:
We can describe the steps as follows:
- First, a would-be application designer starts with a conceptual model: a (possibly very rough) idea of what they would like the application to do. For example, an application designer trying to design “Kudos” might start with a concept like:
“Kudos are individual, fungible tokens. It should be possible for a specific party to issue new kudos from nothing, for any party who owns some kudos to transfer them to another party, and for any party who owns some kudos to burn them (into nothing). Each kudo is always owned by exactly one party, and the consent of that party is required to transfer or burn that kudo. Kudos are fungible, so one kudo of amount a and one of amount b can be combined into one of amount a+b, or one of amount a+b can be split into one of amount a and one of amount b.”
- Second, the application designer takes this conceptual model and attempts to translate it into code.
- Third, the application designer reads, tests, and reasons about a particular application definition.
- Depending on the results of this testing and reasoning, the application designer may iterate on their conceptual model and/or iterate on their application definition and re-run the loop. Eventually (one hopes), they will be satisfied with the application definition and confident that it matches their conceptual model, and the loop terminates successfully with an application that they (or others) can now use.
The specifics here can take many different forms. Let’s consider a few example cases:
- Suppose that we have a hypothetical application designer Annie, where Annie perfectly understands the entire Anoma system and can hold all of it in her mind at once. Annie should be able to simply take the application concept (if it is clear enough) and imagine the simplest set of resource logics, transaction functions, etc. that correctly implement this concept. If the application concept is not yet fully defined, Annie should already be able to tell by imagining the implementation, and she could refine the concept until it is coherent, then type the exactly optimal sequence of keys on her keyboard in order to implement it.
- Suppose that we have another hypothetical application designer Bob, who doesn’t understand Anoma at all, and can only play with it as a black box (e.g. try inputs, read outputs, and gradually build a model of it over time). Luckily for our hypothetical purposes, Bob happens to have an infinite amount of time, so he would simply take the application concept and start entering random inputs into Anoma, testing the outputs, and gradually building a model of the system (properties of the black box) over time, refining his inputs in order to produce output behaviour that matches his desired application concept. Given infinite time, Bob would eventually succeed, although he would never know for sure that the application he has written would actually implement the desired concept in all future cases (there’s nothing he could do to test, for example, that there isn’t some specific number n for which kudos of amount n are treated differently).
- Suppose that we have yet another hypothetical application designer Charlie. Charlie has a perfectly formed application concept – an exact idea of what observable behavior he wants the application to have – but he doesn’t understand Anoma either. However, Charlie has access to a rather magical tool: the Babeloma fish. This Babeloma fish is capable of translating between conceptual models and Anoma application definitions: it can take a conceptual model and produce an Anoma application definition which implements that conceptual model correctly, or take an Anoma application definition, and describe conceptually what observable behaviour that application definition has (in terms that would make sense to Charlie). Even though he doesn’t understand Anoma at all, Charlie can achieve the same results as Annie – a well-formed, correct application definition immediately – by using this Babeloma fish, and he can also use the Babeloma fish to double-check that the application definition produces the behaviour he wants. Charlie does have to trust the Babeloma fish, though.
Right now, in practice, in order to design and write Anoma applications, one has to be pretty close to Annie: understand the resource machine, know Juvix, be able to reason about controllers (when we implement that), etc. These are steep requirements, and even for those who do understand such things, writing applications is a lot of work, much of it finicky and low-level. The low-level languages of Anoma – resources, the resource machine, engines, and the engine model – are powerful components, designed to give programmers exact control over nearly every aspect of how the system or a particular application behaves. Requiring that developers think about all of the possiblities of these low-level interfaces at once, and program manually in them, doesn’t just restrict the accessibility of the system to experts – it limits what even those experts can do. If we want the power of Anoma to be practically accessible, we must start building this Babeloma fish.
What might this Babeloma fish look like? Before we embark upon a project of piscine design, we must first examine another aspect of application design: time.
Temporality
So far, we’ve been assuming that the application designer and application definition exist in a vacuum: the designer operates alone, building an application which is entirely self-contained, without reference in the concept or definitions to existing state anywhere, application definitions elsewhere, or really anything outside this loop at all. This assumption is wildly unrealistic – in fact, it perhaps holds only for the very first Anoma application designer of the very first Anoma application – subsequent applications might want to interoperate with earlier ones, and so must keep them in mind. The real situation looks a little more like:
In particular, I think that there are (at least) a few aspects to keep in mind here:
- Subsequent applications may want to interoperate with prior applications, and so must take into account at least some of the external interfaces of the applications with which they want to interoperate. Applications may even want to design their interfaces so that future applications can easily interoperate with them.
- Technical translations of certain concepts can likely be universal. For example, we can come up with a standard for what it means to “own” something which is independent of any specific authorization mechanism (e.g. signature scheme), so it should work for any application which wants a (standard) notion of “ownership”. Later applications likely don’t want to create a separate-but-equivalent ownership standard – they want to use the one which is already there. Clever design of standards may even allow us to define them in a way which does not rely on any arbitrary names (e.g. field names) (see this discussion), which would help, but application designers will still want to be able to look up and reuse existing patterns.
- The Anoma network itself can store arbitrary data and programs, including application design patterns, prior application definitions, educational material about how Anoma works, even parts of this hypothetical “Babeloma fish” function.
- Applications can and should evolve over time, as their users’ needs change, conceptual models change, other applications change, etc. – the application design loop should not be conceptualized as prior to and exclusive from actual usage, but rather a part of it, which leads us into…
The Leaning Piscine Tower of Babeloma
Who should be able to design applications? Modern computing stacks have created a two-tier class structure: developers – possessed of enough arcane knowledge to bend the system to their will – and users – who lack such knowledge and find themselves at the mercy of the developer-priests. Without even touching upon the social problems which this stratification creates, we can demonstrate its indefensibility by appealing to the basic criterion of efficiency: it is the user who knows what they want, not some separate application designer sitting in an office halfway across the world. Why bother attempting to teach the developer about the user (or regulate the developer into acting in the best interests of the user) if we could simply give the user tools to build, evaluate, and modify applications themself?
What would this take? I think we can start with some boundary constraints:
- The user is not going to learn a new language or the Anoma system model (e.g. how the resource machine works). At most, the user might learn a high-level intuition for how Anoma works by interacting with it over time, and using simple conceptual / visual models which are well-known already (e.g. cells in a spreadsheet). The user must be able to describe their application in natural language – at most manipulate some data flow diagrams or rules in a GUI, but nothing complicated. Similarly, the behavior of applications must be described in natural language or visualized, the user cannot be expected to read any code. The user may be able to handle a higher-level abstract representation (such as “objects”) if this is conceptually easy to grasp and comes with graphical / natural language interaction tooling.
- The user is also not going to learn in detail how existing applications or state on Anoma work. The user may know of a few applications by name or function (having used them before), and want their application to interoperate with those applications in a way which they can describe. The user is not going to know about Anoma development patterns or standards.
- Natural language, preferred visual representations, application standards, existing applications, etc. all change over time – the Babeloma fish must be able to adapt to these changes.
So, what must our Babeloma fish anatomy consist of? Perhaps something like:
There’s one part in this diagram which we haven’t discussed yet: an application description language. What do I mean by this? The general idea is that we may want a higher level language / format to describe what an application should do at a higher level of abstraction than the Anoma “executable code” (e.g. transaction functions + resource logics) itself. The object model under development is one step in this direction, but we’ll probably also want to consider other aspects such as:
- Ways to reason about desired information flow control properties at a higher level.
- Ways to reason about desired trust (or lack-of-trust-required) properties at a higher level.
- Ways to reason about desired interoperability (with other apps) at a higher level.
In some sense, I think we could understand an “application description language” as a translation of a conceptual model (such as the example for kudos above) into a set of explicit constraints and preferences for how an application should work. With such an explicit high-level target, we could likely:
- Analyze whether the target application is possible to realize / underspecified / etc. (at that high level of abstraction) and give feedback to the user.
- Eventually, build a pipeline to construct / search for implementations that implement an application which satisfies those constraints and preferences as best as possible.
The head of the Babeloma fish will necessarily involved natural language, GUIs, LLMs, etc. – but I think we want to make the job of this translation-head as easy as possible by crafting as high-level + declarative as possible a representation of what applications should do. This seems like a natural next step in our development as well.
Enough for one post…