Browse Source

First steps to an actual novy implementation

main
Tony Garnock-Jones 1 year ago
commit
e47a37e3f0
  1. 1
      .gitignore
  2. 9
      box-protocol.prs
  3. 9
      dataspace.prs
  4. 5
      gatekeeper.prs
  5. 14
      protocol.prs
  6. 14
      secure-chat-protocol.prs
  7. 5
      simple-chat-protocol.prs
  8. 43
      sturdy.prs
  9. 4
      worker.prs

1
.gitignore vendored

@ -0,0 +1 @@ @@ -0,0 +1 @@
gen/

9
box-protocol.prs

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
version 1 .
embeddedType Actor.Ref .
BoxState = <BoxState @value int>.
SetBox = <SetBox @value int>.
; BoxCap = BoxState / <Observe =SetBox @observer embedded>.
; ClientCap = SetBox / <Observe =BoxState @observer embedded>.
.

9
dataspace.prs

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
version 1 .
embeddedType Actor.Ref .
;As implemented
Observe = <Observe @label symbol @observer embedded>.
; ;As will be implemented soon
; Observe = <Observe @pattern Pattern @observer embedded>.
.

5
gatekeeper.prs

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
version 1 .
embeddedType Actor.Ref .
Resolve = <resolve @sturdyref sturdy.SturdyRef @observer embedded>.
Bind = <bind @oid any @key bytes @target embedded>.

14
protocol.prs

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
version 1 .
embeddedType sturdy.WireRef .
Assertion = any .
Handle = int .
Event = Assert / Retract / Message / Sync .
Oid = int .
Turn = [TurnEvent ...].
TurnEvent = [@oid Oid @event Event].
Assert = <assert @assertion Assertion @handle Handle>.
Retract = <retract @handle Handle>.
Message = <message @body Assertion>.
Sync = <sync @peer embedded>.

14
secure-chat-protocol.prs

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
version 1 .
embeddedType Actor.Ref .
UserId = int .
Join = <joinedUser @uid UserId @handle embedded>.
NickClaim = <claimNick @uid UserId @name string @k embedded>.
UserInfo = <user @uid UserId @name string>.
Says = <says @who UserId @what string>.
NickConflict = <nickConflict>.

5
simple-chat-protocol.prs

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
version 1 .
embeddedType Actor.Ref .
Present = <Present @username string>.
Says = <Says @who string @what string>.

43
sturdy.prs

@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
version 1 .
; Each Attenuation is a stage. The sequence of Attenuations is run RIGHT-TO-LEFT.
; That is, the newest Attenuations are at the right.
SturdyRef = <ref @oid any @caveatChain [Attenuation ...] @sig bytes>.
; An individual Attenuation is run RIGHT-TO-LEFT.
; That is, the newest Caveats are at the right.
Attenuation = [Caveat ...].
; embodies 1st-party caveats over assertion structure, but nothing else
; can add 3rd-party caveats and richer predicates later
Caveat = Rewrite / Alts .
Rewrite = <rewrite @pattern Pattern @template Template>.
Alts = <or @alternatives [Rewrite ...]>.
Oid = int .
WireRef = @mine [0 @oid Oid] / @yours [1 @oid Oid @attenuation Caveat ...].
;---------------------------------------------------------------------------
ConstructorSpec = CRec / CArr / CDict .
CRec = <rec @label any @arity int>.
CArr = <arr @arity int>.
CDict = <dict>.
Lit = <lit @value any>.
Pattern = PDiscard / PAtom / PEmbedded / PBind / PAnd / PNot / Lit / PCompound .
PDiscard = <_>.
PAtom = =Boolean / =Float / =Double / =SignedInteger / =String / =ByteString / =Symbol .
PEmbedded = =Embedded .
PBind = <bind @name symbol @pattern Pattern>.
PAnd = <and @patterns [Pattern ...]>.
PNot = <not @pattern Pattern>.
PCompound = <compound @ctor ConstructorSpec @members PCompoundMembers>.
PCompoundMembers = { any: Pattern ...:... }.
Template = TRef / Lit / TCompound .
TRef = <ref @name symbol>.
TCompound = <compound @ctor ConstructorSpec @members TCompoundMembers>.
TCompoundMembers = { any: Template ...:... }.

4
worker.prs

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
version 1 .
embeddedType Actor.Ref .
Instance = <Instance @name string @argument any>.
Loading…
Cancel
Save