Skip to content

Commit

Permalink
lang: interfaces: Remove Func signature
Browse files Browse the repository at this point in the history
This is actually not required anywhere because Graph handles this. We
might still see these methods around as helpers, but they're not part of
the interface.
  • Loading branch information
purpleidea committed Sep 19, 2023
1 parent e8ebf5b commit 991ac1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
9 changes: 4 additions & 5 deletions docs/language-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -563,21 +563,20 @@ would like to propose a more logical or performant variant.

#### Function graph generation

At this point we have a fully type AST. The AST must now be transformed into a
At this point we have a fully typed AST. The AST must now be transformed into a
directed, acyclic graph (DAG) data structure that represents the flow of data as
necessary for everything to be reactive. Note that this graph is *different*
from the resource graph which is produced and sent to the engine. It is just a
coincidence that both happen to be DAG's. (You don't freak out when you see a
coincidence that both happen to be DAG's. (You aren't surprised when you see a
list data structure show up in more than one place, do you?)

To produce this graph, each node has a `Graph` method which it can call. This
starts at the top most node, and is called down through the AST. The edges in
the graphs must represent the individual expression values which are passed
from node to node. The names of the edges must match the function type argument
names which are used in the definition of the corresponding function. These
corresponding functions must exist for each expression node and are produced by
calling that expression's `Func` method. These are usually called by the
function engine during function creation and validation.
corresponding functions must exist for each expression node and are produced as
the vertices of this returned graph. This is built for the function engine.

#### Function engine creation and validation

Expand Down
3 changes: 0 additions & 3 deletions lang/interfaces/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ type Expr interface {
// returns the collection to the caller.
Unify() ([]Invariant, error)

// Func returns a function that represents this reactively.
Func() (Func, error)

// Graph returns the reactive function graph expressed by this node. It
// takes in the environment of any functions in scope. It also returns
// the function for this node.
Expand Down

0 comments on commit 991ac1a

Please sign in to comment.