-
Notifications
You must be signed in to change notification settings - Fork 10
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
Alternative syntax with a classic memory read/write style #8
Comments
lol
On Thu, Oct 8, 2015 at 6:25 AM, Nicolas Pouillard [email protected]
Sent by an Internet |
Here is an alternative proposal reusing The example could then be:
or shorter:
|
I'm leaning towards following the syntax of Go for sending/receiving on channels. The idea is to use "<-" as the visual marker for what goes in or out of a channel. In summary here is my new proposal:
For the new syntax for #16, we should not use "=" for the reason mentioned above. We could extend the syntax of receive but this not really good to explain. I'm leaning towards using "<=" as a mix: For instance |
In short: * `send c t` can now be written as `c <- t`. * `recv c (x : A)` can now be written as `let x : A <- c`. Moreover: * One can now use `;` in place of `.`. * One can use the keyword `split` before splits. * `<- c` is recognized as a term and `let x : A <= t` as an action. These are not handled yet (Issue #16). Finally ling-fmt as evolved to treat this syntax change: * Albert.cf has been improved with the changes above except for the keyword `split`. This syntax version is now frozen. * Benjamin.cf has been created as an identical copy of Ling.cf so far. Now when Ling.cf changes one should update Benjamin.cf.
|
An example:
Essentially
recv c (x : A)
becomes(x : A) := @c
andsend c t
becomes@c := t
.So far the use of
@
conflicts with its use to embed terms but so far I think it goes nicely with the idea of a location.A more aggressive change would be to always write channels with a
@
symbol. This could help making things more obvious at many levels but also look noisy and reminds of too many scripting languages...The text was updated successfully, but these errors were encountered: