Skip to content

Instantly share code, notes, and snippets.

@Gozala
Created April 11, 2024 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gozala/5af5ed5041e506d00adb895382efb641 to your computer and use it in GitHub Desktop.
Save Gozala/5af5ed5041e506d00adb895382efb641 to your computer and use it in GitHub Desktop.
Sketch of the workflow syntax
;; Type definition for the Blob. It has no inputs and two outputs
; `digest` and `size`. It is kind of like a rule without a body
(Blob : { :digest Bytes :size Int })
(Site : { :url String :headers (Map :key string :value string) })
;; ℹ️ Unlabelled parameter can be refereced by `.`
(Result :error : (:ok . :error .error))
;; Composed task is rule that maps input to tasks and maps task outputs
;; to the output of the composed task
(blob/add
;; Describes input parameters of the rule mapped to their types
:blob Blob
;; Describes output bindings of the rule mapped to their types
: (Result {:site Site})
;; Describes set of labeled references that are either task invocations
;; or queries on the outputs they produce. Labels are only for the humans
;; and don't carry into the actual definitions where all references are
;; by hash of the labeled reference.
{ :location (/memory/allocate
;; binds space paramater to the unlabeled parameter - sub(ject)
;; of the invocation
:space .
;; binds blob parameter to the blob parameter of this invocation
:blob .blob)
:put (/http/put
;; binds url parameter to the `.location.out.ok.url` of the
;; location task
:url location.ok.url
:headers location.ok.headers
:body .blob)
:content (/memory/accept :space . :blob .blob :: put.ok)
:site content.ok.site
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment