From 6b4b61d4bc0fd6b94b9aa0105538ef5f4f2ea4a5 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 21 Mar 2018 20:27:27 -0400 Subject: [PATCH] Plansss Gamelan music currently playing: Relaksasi Musik Jawa --- forest.go | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) 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 }