Reorder alternatives to fail by default #11

Open
ehmry wants to merge 1 commits from ehmry/syndicate-protocols:close-on-fail into main
Contributor

Order alternatives such that a language runtime that initializes
objects to the first alternative will initialize fresh objects in
a "fail closed" rather than a "fail open" state.


The bundle was generated with a different compiler but it should match the output of the Javascript compiler.

Order alternatives such that a language runtime that initializes objects to the first alternative will initialize fresh objects in a "fail closed" rather than a "fail open" state. --- The bundle was generated with a [different compiler](https://git.syndicate-lang.org/ehmry/preserves-nim/src/branch/trunk/src/preserves/preserves_schemac.nim) but it should match the output of the Javascript compiler.
ehmry added 1 commit 2024-05-22 17:19:37 +00:00
6b39affde1 Reorder alternatives to fail by default
Order alternatives such that a language runtime that initializes
objects to the first alternative will initialize fresh objects in
a "close-on-fail" rather than a "open-on-fail" state.
ehmry force-pushed close-on-fail from 6b39affde1 to 7b3facfb78 2024-05-22 17:20:25 +00:00 Compare
tonyg requested changes 2024-05-23 07:19:18 +00:00
tonyg left a comment
Owner

Most of these make sense, but for some, there's no natural notion of a "default" that would make sense. I've put a note on the ones I'm unsure about. (To be clear: this is more a request for discussion than changes per se. The PR is in principle mergeable as it stands I believe.)

Most of these make sense, but for some, there's no natural notion of a "default" that would make sense. I've put a note on the ones I'm unsure about. (To be clear: this is more a request for discussion than changes per se. The PR is in principle mergeable as it stands I believe.)
@ -1,6 +1,6 @@
version 1 .
Packet = Turn / Error / Extension / Nop .
Packet = Error / Turn / Extension / Nop .
Owner

Does it make more sense for the default to be an error (which requires a message! ... the default of which would presumably be the empty string??) or an empty turn with no events? I'd argue the latter.

Does it make more sense for the default to be an error (which requires a message! ... the default of which would presumably be the empty string??) or an empty turn with no events? I'd argue the latter.
ehmry marked this conversation as resolved
@ -29,2 +29,4 @@
# Possible service states.
State =
/ # The service has failed.
=failed
Owner

This one I'm unsure about. Is the "default" state more likely to be "failed" or "started"? Does "default" even make sense here? ... Perhaps I'm misunderstanding the constraints leading to this pull request!

This one I'm unsure about. Is the "default" state more likely to be "failed" or "started"? Does "default" even make sense here? ... Perhaps I'm misunderstanding the constraints leading to this pull request!
ehmry marked this conversation as resolved
@ -38,3 +38,3 @@
# embodies 1st-party caveats over assertion structure, but nothing else
# can add 3rd-party caveats and richer predicates later
Caveat = Rewrite / Alts / Reject / @unknown any .
Caveat = Reject / Rewrite / Alts / @unknown any .
Owner

This one definitely feels like the idea of a "default" or zero value is inappropriate for.

This one definitely feels like the idea of a "default" or zero value is inappropriate for.
ehmry marked this conversation as resolved
@ -3,3 +3,3 @@
SetTimer = <set-timer @label any @seconds double @kind TimerKind>.
TimerExpired = <timer-expired @label any @seconds double>.
TimerKind = =relative / =absolute / =clear .
TimerKind = =clear / =relative / =absolute .
Owner

Similarly, there's no obvious default action here. (Though the timer protocol is ripe for wholesale revision anyway... sleeping and delays and timeouts are good candidates for inclusion in a core Turn interface. Clocks still need a protocol.)

Similarly, there's no obvious default action here. (Though the timer protocol is ripe for wholesale revision anyway... sleeping and delays and timeouts are good candidates for inclusion in a core Turn interface. Clocks still need a protocol.)
ehmry marked this conversation as resolved
ehmry force-pushed close-on-fail from 7b3facfb78 to 27c7bbfd27 2024-05-26 11:40:30 +00:00 Compare
Author
Contributor

The first patch I took it to the max. I force pushed a more conservative patch.

The first patch I took it to the max. I force pushed a more conservative patch.
ehmry force-pushed close-on-fail from 27c7bbfd27 to 464605bb1d 2024-05-26 11:44:27 +00:00 Compare
This pull request has changes conflicting with the target branch.
  • schema-bundle.bin
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b ehmry-close-on-fail main
git pull close-on-fail

Step 2:

Merge the changes and update on Forgejo.
git checkout main
git merge --no-ff ehmry-close-on-fail
git push origin main
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: syndicate-lang/syndicate-protocols#11
No description provided.