Mind Language

Overview of the Mind Language

Mind is a graph based meta programming language. The graph structure is explicitly designed to be easy for Large Language Models (LLMs) to understand and interact with it, so that the progress in Generative Artificial Intelligence (GenAI) can be harnessed to both quickly extend the capabilities of the language, adapting it to a specific domain, and facilitating the interaction with the user. To understand how this is possible, it is first necessary to understand what a Domain Specific Languge is and how Mind leverages artificial intelligence to abstract over it.

General Domain Specific Language (GDSL)

Domain Specific Language (DSL)

A Domain-Specific Language (DSL) is a specialized programming language designed to address specific domains or problem areas. It provides a concise and expressive syntax tailored to a particular domain, making it easier for users to program the solution for their needs within that domain. DSLs are typically focused on solving specific problems within a specific industry or application area, enabling users to communicate and work effectively within their specialized domain without the need for extensive general-purpose programming knowledge. MATLAB is a good example of a quite complex DSL that works because it is focused on a domain.

DSL Limitations

The development of Domain-Specific Languages (DSLs) requires custom implementation for every specific domain. This involves creating tailored syntax, semantics, and tools from scratch, making this process time-consuming and resource-intensive.

Generic DSL (GDSL)

A Generic Domain Specific Language (GDSL) is a meta-language that abstracts Domain-Specific Languages (DSLs) to generate a seamless correspondence, between a DSL and any specific domain. A useful comparison that allows to grasp the concept and builds intuition is to think to the GDSL as the grammar and a DSL generated with it as the semantics.

The building blocks of Mind are the following:

  • Nodes, that represent small bits of computation. Each node has a unique identifier that is referred in the scopes (read below) and is used to build the edges of the graph. The entry points of the direct graph are called Start Nodes, the ending points are called End Nodes. Notice that while End Nodes are sinks, Start Nodes are not necessarily sources. Every node that is not a Start Node or an End Node is a Middle Node, which are the functional part of the structure and do not have impact outside the graph itself.

  • Scopes, are a set of entries identified by an hash that is given by the hash of the sorted list of the hashes of the nodes that compose the scope. For instance, the hash of the sorted list of all the node hashes is the hash of the global scope. Note that since the underlying graph is directed, the order in the scope matters so the scope of (A, B) is not the scope of (B, A). Since the hash of the two is different, there will be two scopes.

  • Graph, a directed graph that represents an application, or a stand-alone component of a larger one. Links between nodes create the sequence of actions which are performed in the execution and interpretation of the graph i.e. they represent the control flow.

  • Controllers, the master controller manages other controllers, each one having mastery over one aspect of the application. They are: graph, event, error, execution, scope.

  • Executor, which performs the action represented by the node. This can be done through a synchronous or an asynchronous task. The main task of the executor is to manage different Walkers, which can be thought as markers that track the execution of the program. When the application is started, a walker is spawned for each start node, then every walker will follow its path until reaching a Conditional or End node. Conditional nodes are crossroads in the pathway, so they will cause more Walkers to be spawned.

Domain-specific extensions for specialized applications

The adaptability of this graph-based language across different domains is a key feature, since its ability to create specialized nodes. By designing and implementing these nodes to cater to unique demands and tasks of various domains, the language can effortlessly adapt to diverse applications.

Last updated