Comments (4)
This is how I see it.
First, the definition of a nodes, edges and graphs
- A Node is an abstract entity that represents something
- Edges represent some relation between two nodes
- A Graph is the pair consisting of a set of Nodes and a set of Edges
Now in Trickle, I see Func as a node class. The call(Func).with(Graph*)
sequence instantiates an actual Node from a Func and creates eventual Edges to other subgraphs. The difference from the above definition is that the Graph is not only the collection of nodes and edges, but it also points out the sink of the DAG. Meaning, our Graph type represents a single component DAG with a unique sink. V = {v1,v2,...}, E = {(vx,vy),(vz,vu),...}, S = vx
where vx,vy,vz,vu ∈ V
. It is this sink node you refer to when calling with(Graph*)
.
We only ever have references to a single Node and nothing else (the only case I would se an ambiguity between a Node and a Graph) when the Func used does not have any inputs. But this ambiguity does not contradict this entity being a Graph. A graph can just as well be V = {x}, E = ∅, S = x
from trickle.
I think the name Graph is correct. A Trickle Graph is something that can be executed, perhaps requiring some inputs to be bound to values. I agree that individual Nodes are invisible, but I wonder which came first - the reasons why we're working with entire graphs at all times are:
- to make composing graphs easier, so you can have libraries, etc., defining graphs that can be used later on.
- to make it easier to come up with a palatable and typesafe API. The previous iteration with
finallyCall
to identify the sink node was much less elegant.
But I think it's a bit weird that what you happens when you do Trickle.call(func).with(graph)
is to construct a new node and attach it as a new sink to the previous graph. The call().with()
doesn't sound like you're doing graph manipulation. There may be a tradeoff here between highlighting the graph nature of what Trickle does and making the code read like a sequence of function invocations.
from trickle.
I think call(Func).with(Graph*) is equivalent to creating a new node with directional edges to other nodes. It's thus odd that the other nodes are called Graph. I don't think the Func itself is a node, that's a property of the node.
from trickle.
I agree Func and Node are different things, and I think both the views of the Func being a property of the Node and being the class of the Node make sense.
I also agree that what call(Func).with(Graph*)
does is create a new node with edges to other nodes. Those nodes are the sink nodes of the graphs passed as arguments, not the graphs themselves. Using graphs as input parameters to .with()
is convenient but not very clear/precise. Not returning the full Graph from a call().with().etc()
sequence would probably be more inconvenient, I think. Also, it would mean users would have to deal with Nodes directly, adding one more type you need to understand.
from trickle.
Related Issues (9)
- Publish on sonatype/Maven central
- Update usage instructions in README until artifacts are in Maven central
- Create wiki pages
- Formalise contract of NodeInfo with unit tests
- Create example based on playlistdecorator from user-profile-view and maybe nameless-registry
- Submit version 0.6.1 to Maven central HOT 3
- Pass the exception to next node HOT 1
- Documentation executor required HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trickle.