diff --git a/forest.go b/forest.go index 38d48b4..b753bca 100644 --- a/forest.go +++ b/forest.go @@ -22,6 +22,30 @@ func (b *BaseAST) GetChildren() []AST { return []AST{} } +func (b *BaseAST) Execute() error { + // actual docker + + // but wait, what parts of the AST actually have their own containers? + // containers are like memory cells and DLIIs are like memory pointers, + // so anything we are storing in memory we will give its own docker container + // this means variables, expressions, and functions (which are basically just + // expressions) will have their own containers. Literals will not. The variable + // declaration operator will spin up an new unbound variable container while + // the variable assignment operator will set the value within that container. + // + // we will be using the docker golang api since docker is written + // in go and therefore we can just talk directly to docker through + // this code. + // before execution of anything, create a docker network + // when we run a docker container, we must give it the network name + // and the computation type (some data structure we haven't decided on yet) + // for it to execute + // each container will persist until that computation is no longer in scope + // within the source code. + // to that end, we can implement a very simple garbage collector or something. + return nil +} + func (b *BaseAST) Eval() error { var ( err error @@ -38,7 +62,7 @@ func (b *BaseAST) Eval() error { } // we've computed all dependencies, now lets eval this thang - err = b.Eval() + err = b.Execute() if err != nil { return err }