Last active
April 24, 2019 21:46
-
-
Save mmerce/2be75b0470c50f0c9580714bacc8bb6e to your computer and use it in GitHub Desktop.
WhizzML executes WhizzML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Creating two scripts to be run together in the same execution | |
;; The scripts share no data and are not related, so they can be executed in parallel | |
;; the parameter for the execution is a list of maps describing each script | |
;; and its inputs | |
;; creating the first script to add two numbers | |
(define script1 (create-script {"source_code" "(+ a b)" | |
"name" "Sum script" | |
"inputs" [{"type" "number" "name" "a"} | |
{"type" "number" "name" "b"}]})) | |
;; creating the second script to multiply two numbers | |
(define script2 (create-script {"source_code" "(* c d)" | |
"name" "Multiplication script" | |
"inputs" [{"type" "number" "name" "c"} | |
{"type" "number" "name" "d"}]})) | |
;; executing both scripts in parallel with some inputs. The result will be a list of executions | |
(define execution-output | |
(wait* (create* "execution" [{"script" script1 "inputs" [["a" 1] ["b" 2]]} | |
{"script" script2 "inputs" [["c" 3] ["d" 4]]}]))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment