Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sequential new #28

Open
np opened this issue Dec 19, 2015 · 0 comments
Open

Sequential new #28

np opened this issue Dec 19, 2015 · 0 comments

Comments

@np
Copy link
Owner

np commented Dec 19, 2015

This document should track the introduction of two additional forms for new which matches the existence of sequencing. For instance !Int.?Int and [:!Int, !Bool:].

Currently new[...] imposes parallelism to the sub processes interacting with the new channel, this is out of place in the context of sequential computation.

The simplest form of sequential new would only take the type of the data exchanged on the channel, moreover a single channel name is introduced. For instance: new (c : Int) creates a sequential channel on which one can send and receive values of type Int. The only constraint on the use of c is to send/write before one receives/reads.

Consider a process such as new (c : A). P one simply infers the protocol for P at the channel c and checks that it matches a non-empty sequential repetition of !A.?A.

The second form of sequential new is taking two channels (maybe more) surrounded by [:...:], namely new[: c : S, c' : S' :]. The first session must be a source, namely only made of !A, {...}, [...] and [:...:]. The second session must have ?A instead of !A but arrays could be non dual.

This last condition is a bit subtle if S' is the dual of S then we have the guarantee that we can fuse the channel, this guarantee further extends when tensors meet ([!A,!B] vs [?A,?B]) since we can still fuse these. The only case we cannot fuse is when pars meet ({!A,!B} vs {?A,?B}) indeed the processing order is arbitrary on both sides so we really need this intermediate space. Since we want new to support fusion by default. To solve this we will require new to be annotated by alloc (Issue #24) when a par meets a par.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant