Object graph
Implemented a Programming Language

metaL (metaprogramming layer/language)


no-syntax language defined over EDS (executable data structures):

  • there are no syntax parser and source code files
  • any composite data structure in memory or disk storage can be active by using an EDS-interpreter which executes it as a program representation
  • homoiconic object graph: code and data can share the same representation, in a form of linked objects references each other

The base Object class instantiates nodes in a directed hypergraph:

## base object (hyper)graph node = Minsky's Frame
class Object:
    def __init__(self, V):

        ## type/class tag /required for PLY/
        self.type = self.__class__.__name__.lower()

        ## scalar value: name, number, string,..
        self.value = V

        ## associative array = env/namespace = map
        self.slot = {}

        ## ordered container = vector = stack = queue = AST
        self.nest = []

        ## global unical id
        ## can differ two objects identical by its content
        self.gid = id(self)

Graph node classes inherited from the base Object give a universal knowledge representation, giving specific semantics by a node type to the universal data structure. Due to the mixing of the associative array and ordered container, any source code can be represented as an attributed grammar structure. In the same way, this object (hyper)graph can be used as-is for any program representation, or any data in a homoiconic manner.

The ability of these data structure classes can be expanded with method sets (interfaces), which are able to evaluate subgraphs as program expressions, modify parts of this object graph, or compile it with generating source code in any programming languages (generative metaprogramming).