Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
G
goblins
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 7
    • Issues 7
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 1
    • Merge Requests 1
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • spritely
  • goblins
  • Issues
  • #17

Closed
Open
Opened Jan 10, 2021 by Christopher Lemmer Webber@dustywebOwner

Return of <<- (eg, "await" / coroutines)

Here I'm considering returning adding coroutines to Goblins. They'd work a bit differently than before, allowing composition in environments when called with $ but without being able to interfere with anyone lower on the stack, thereby blocking re-entrancy attacks.

Instead of suspending to the top of the turn, an actor using <<- would suspend to the top of its own call and would return a promise.

In effect, the following code would be equivalent:

(define ((^alice bcom bob))
  (displayln "before")
  (define from-bob (<<- bob "hello"))
  (displayln "after"))
(define ((^alice bcom bob))
  (displayln "before")
  (on (<- bob "hello")
      (lambda (from-bob)
        (displayln "after"))
      #:promise? #t))

<<- should be interpreted not only as await but also as potentially "oh yeah I'm going so fast oh shiiiii" for the usual reasons: it's different than $ in that the world is likely to change on you.

The choice to return #:promise? #t probably will DTRT by default with asynchronous stuff due to promise pipelining/chaining/etc, and it also provides a path out for doing something sensible with $.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: spritely/goblins#17