Skip to content

Commit

Permalink
Plansss
Browse files Browse the repository at this point in the history
Gamelan music currently playing: Relaksasi Musik Jawa
  • Loading branch information
mouse-reeve committed Mar 22, 2018
1 parent e6342c3 commit 6b4b61d
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion forest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down

0 comments on commit 6b4b61d

Please sign in to comment.