Seed is a declarative distributed systems language.
Its main goals are to be analyzable and transformable such that a service can be specified in the language and then transformations can be applied to implement various things such as dealing with network interfaces and data replication.
This language is experimental! It is not finished yet!
- Install go: http://golang.org/doc/install
- Install Seed
go get github.com/nathankerr/seed/seed
The examples directory contains example transformations and services.
The kvs directory contains a Key Value Store service.
The time directory contains a time service which calculates the current time for a given timezone.
Adds a network interface to a service without one by changing input and output collections to channels and adding and handling the required network addresses through the service.
Changes table collections such that their contents are replicated between several of the same services running in a replica group.
Seed does not deal with types (this includes literals) because it couples the Service definition to a specific host environment and serialization mechanism. For example, to add a conditional like "table.column < 42" would require knowing what type table.column is, that it is comparable with whatever 42 is, and how to do the comparison. It might be fairly simple in this case, but soon becomes complicated with floating point, decimal, signed and unsigned numbers, etc. It gets worse with user defined types which then also need serialization code, etc.
The solution here is to leave typing to the host environment and out of Seed. If constants (such as the aforementioned 42) are needed, a table can be created to hold that single value and the actual value can be added at start up. The value can then be referenced as life_the_universe_and_everything.answer.
operations to handle:
- =
- <
-
- <=
-
=
- in (true if element in set)
- not (boolean negation)
operations have equal precedence, grouping with ()
type CompareFn func(a Element, b Element) (int, error) returns < 0 if a < b returns 0 if a == b returns > 0 if a > b returns error if comparison not possible
register functions in a comparison map
comparisons map[string]map[string] CompareFn each string is a qualified column, order does not matter (i.e., will check a,b and b,a for a function)
during startup, check if needed comparisons are registered. If not, list the one which are missing
- boolean expressions for predicates
- lattice types? How to do without type knowledge? Do the lattice types impose or imply some sort of type classing that would need to be matched or ensured by the host environement?
- list and check for functions required by the host environment for a particular seed
- finish cart implementation