aboutsummaryrefslogtreecommitdiff
path: root/ccwl
AgeCommit message (Collapse)Author
2022-01-16ccwl: Raise parameter errors in workflow steps as exceptions.Arun Isaac
* ccwl/ccwl.scm (collect-steps): Raise parameter errors in workflow steps as exceptions.
2022-01-16ccwl: Raise undefined ccwl command error as exception.Arun Isaac
* ccwl/ccwl.scm (collect-steps): Raise undefined ccwl command error as a &ccwl-violation condition.
2022-01-16ccwl: Raise exceptions on command syntax errors.Arun Isaac
* ccwl/ccwl.scm (command): Raise &ccwl-violation conditions on syntax errors. * tests/ccwl.scm ("command, when passed positional arguments, must raise a &ccwl-violation condition", "command, when passed an unrecognized keyword, must raise a &ccwl-violation condition", "command, when passed multiple arguments to a unary keyword, must raise a &ccwl-violation condition"): New tests.
2022-01-16ccwl: Raise exceptions on output syntax errors.Arun Isaac
* ccwl/ccwl.scm (output): Raise &ccwl-violation conditions on syntax errors. * tests/ccwl.scm (output): New function. ("output, when passed more than one positional argument, must raise a &ccwl-violation condition", "output, when passed an unrecognized keyword, must raise a &ccwl-violation condition", "output, when passed multiple arguments to a unary keyword, must raise a &ccwl-violation condition"): New tests.
2022-01-16ccwl: Raise exceptions on input syntax errors.Arun Isaac
* ccwl/ccwl.scm: Import (rnrs conditions), (rnrs exceptions) and (ccwl conditions). (input, input-spec-id): Raise &ccwl-violation conditions on syntax errors. * tests/ccwl.scm: Import (rnrs exceptions) and (ccwl conditions). (input): New function. ("input, when passed more than one positional argument, must raise a &ccwl-violation condition", "input, when passed an unrecognized keyword, must raise a &ccwl-violation condition", "input, when passed multiple arguments to a unary keyword, must raise a &ccwl-violation condition"): New tests.
2022-01-16ccwl: Delete plist->alist.Arun Isaac
plist->alist is not used anywhere. pairify is quite sufficient to take on its functionality. * ccwl/utils.scm (plist->alist): Delete function. * tests/utils.scm ("plist->alist"): Delete test.
2022-01-16ccwl: Document default default value of syntax-lambda**.Arun Isaac
* ccwl/utils.scm (syntax-lambda**): Document default default value. * tests/utils.scm ("default default value of syntax-lambda** unary argument should be #f", "default default value of syntax-lambda** n-ary argument should be the empty list"): New tests.
2022-01-16ccwl: Clarify default default value of lambda**.Arun Isaac
* ccwl/utils.scm (lambda**): Change "default value" to "default default value" in docstring. * tests/utils.scm ("default value of lambda** unary argument should be #f", "default value of lambda** n-ary argument should be the empty list"): Change "default value" to "default default value".
2022-01-16ccwl: Do not expand to syntax values.Arun Isaac
Macros should not normally expand to syntax values as constant literals. We now do more work at the macro-expansion phase so that this is not necessary. * ccwl/ccwl.scm (collect-steps): In the returned <step> objects, put syntax to reference function object instead of the function object itself. (key->output): Return syntax to construct an <output> object instead of the <output> object itself. (workflow): Do not expand to syntax values as constant literals.
2022-01-16ccwl: Remove out field from <step> type.Arun Isaac
The out field of a <step> object can be derived from its run field. There is no need to store it. Therefore, we remove the out field and implement the accessor step-out as a separate function so that we don't break existing code. We also move around some code so that all variables are defined before they are used. * ccwl/ccwl.scm (function-objects): Move to just after <command> and <cwl-workflow> type definitions. (<step>): Remove out field. Move to after function-objects. (step-out): New function. (collect-steps): Do not set out field of <step> object.
2022-01-16scripts: Report ccwl syntax violations.Arun Isaac
* ccwl/ui.scm: New file. * scripts/ccwl: Import (rnrs exceptions), (srfi srfi-28), (ccwl conditions) and (ccwl ui). (main): Handle ccwl syntax violations by reporting them and exiting.
2022-01-16ccwl: Add &formatted-message condition.Arun Isaac
* ccwl/conditions.scm (&formatted-message): New condition. (formatted-message): New function.
2022-01-16ccwl: Raise lambda** and syntax-lambda** errors as exceptions.Arun Isaac
* ccwl/conditions.scm (&unrecognized-keyword-assertion, &invalid-keyword-arity-assertion, &invalid-positional-arguments-arity-assertion): New conditions. * ccwl/utils.scm: Import (rnrs conditions), (rnrs exceptions) and (ccwl conditions). (group-keyword-arguments): Raise &invalid-keyword-arity-assertion on error. (lambda**, syntax-lambda**): Raise &unrecognized-keyword-assertion, &invalid-keyword-arity-assertion and &invalid-positional-arguments-arity-assertion on error. * tests/utils.scm: Import (rnrs conditions), (rnrs exceptions), (srfi srfi-1) and (ccwl conditions). ("lambda** should raise an &unrecognized-keyword-assertion on unrecognized keywords in arguments with syntax objects as irritants"): Check for &unrecognized-keyword-assertion. ("Unrecognized keyword argument passed to lambda** should raise an &unrecognized-keyword-assertion condition", "Unary lambda** keyword argument passed multiple arguments should raise an &invalid-keyword-arity-assertion condition", "Wrong number of positional arguments to lambda** should raise an &invalid-positional-arguments-arity-assertion condition", "syntax-lambda** should raise an &unrecognized-keyword-assertion on unrecognized keywords in arguments", "Unrecognized keyword argument passed to syntax-lambda** should raise an &unrecognized-keyword-assertion condition with syntax objects as irritants", "Unary syntax-lambda** keyword argument passed multiple arguments should raise an &invalid-keyword-arity-assertion condition", "Wrong number of positional arguments to syntax-lambda** should raise an &invalid-positional-arguments-arity-assertion condition"): New tests.
2022-01-16ccwl: Add conditions.Arun Isaac
We introduce the &ccwl-violation condition. In later commits, it will be used to indicate ccwl syntax violations and to print out useful compiler errors. * ccwl/conditions.scm: New file.
2022-01-16ccwl: Indent lambda** docstring examples correctly.Arun Isaac
* ccwl/utils.scm (lambda**): Indent docstring examples correctly.
2021-12-17Create specialized type for graphviz edge.Arun Isaac
* ccwl/graphviz.scm (<graph-edge>): New type. (graph-edge): New function. (graph->dot): Support specification of edges using the <graph-edge> type.
2021-12-17Abstract out serialization of graphviz properties.Arun Isaac
* ccwl/graphviz.scm (serialize-properties): New function. (graph->dot): Use serialize-properties.
2021-12-13ccwl: Support graphviz node ports.Arun Isaac
* ccwl/graphviz.scm (<graph-port>): New type. (serialize): Support <graph-port> objects. * tests/graphviz.scm (graph-port): New function. ("serialize ports correctly"): New test case.
2021-12-13ccwl: Organize serialize into a generic function.Arun Isaac
* ccwl/graphviz.scm (serialize): Organize into a generic function that dispatches on input type.
2021-12-13ccwl: Escape only the double quote character in graphviz output.Arun Isaac
* ccwl/graphviz.scm: Import (ice-9 string-fun). (serialize): When quoting strings, escape only the double quote character. * tests/graphviz.scm ("do not escape backslashes"): New test case.
2021-12-13ccwl: Support graphviz HTML strings.Arun Isaac
* ccwl/graphviz.scm (<html-string>): New type. (escape-id): Delete function. (serialize): New function. (graph->dot): Use serialize instead of escape-id. * tests/graphviz.scm: New file. ("serialize HTML strings correctly"): New test case. * Makefile.am (SCM_TESTS): Register it.
2021-11-02ccwl: Support external CWL workflows.Arun Isaac
* ccwl/ccwl.scm: Import (yaml). Export cwl-workflow?, cwl-workflow, cwl-workflow-file, cwl-workflow-inputs and cwl-workflow-outputs. (<cwl-workflow>): New type. (cwl-workflow, function-input-keys, function-outputs, function-object): New functions. (command-input-keys, command-object): Delete functions. (collect-steps): Replace command-object with function-object, command-input-keys with function-input-keys and command-outputs with function-outputs. * ccwl/cwl.scm (workflow->cwl-scm): Handle <cwl-workflow> objects. * tests/ccwl.scm ("read all forms of inputs and outputs from a CWL workflow"): New test. * guix.scm: Import (gnu packages guile-xyz) and (guix utils). (guile-libyaml): New variable. (ccwl)[inputs]: Add guile-libyaml.
2021-11-02ccwl: Rename graphviz to dot.Arun Isaac
What we call "graphviz syntax" is actually the "graphviz dot language". Rename accordingly. * ccwl/graphviz.scm (workflow->graphviz): Rename to workflow->dot. Call graph->dot instead of graph->graphviz. (escape-id): Update docstring to mention dot. (graph->graphviz): Rename to graph->dot. Update docstring to mention dot. * scripts/ccwl.in (main): Accept --to=dot instead of --to=graphviz. Update --help usage information. * Makefile.am (%.dot): Pass --to=dot instead of --to=graphviz.
2021-10-18ccwl: Fix indentation and paragraph filling.Arun Isaac
* ccwl/ccwl.scm (collect-steps): Fix indentation. (key->output): Fill paragraph.
2021-10-18ccwl: Implement rename to rename keys between steps.Arun Isaac
* ccwl/ccwl.scm (collect-steps): Implement rename to rename keys between steps.
2021-10-18ccwl: Improve comment describing handling of single input commands.Arun Isaac
* ccwl/ccwl.scm (collect-steps): Improve comment describing handling of single input commands. Mention that it applies only when no inputs are passed to it.
2021-10-18ccwl: Add setter for name field of <key> type.Arun Isaac
* ccwl/ccwl.scm (<key>): Add setter set-key-name.
2021-10-18ccwl: Separate ccwl key from CWL input/output id.Arun Isaac
* ccwl/ccwl.scm (<key>): Add cwl-id field. (key): Initialize cwl-id field. (key->output): Match the cwl-id of keys to the id of outputs, instead of matching the name of keys to the id of outputs. (cwl-key-address): Use the cwl-id of keys when outputting to CWL.
2021-10-12ccwl: Implement compiling to graphviz.Arun Isaac
* ccwl/yaml.scm (indent-level): Import (ccwl utils). Move to ... * ccwl/utils.scm (indent-level): ... here. Export indent-level. * ccwl/graphviz.scm: New file. * Makefile.am (SOURCES): Register it.
2021-10-11ccwl: Remove unused invoke-command function.Arun Isaac
* ccwl/ccwl.scm (invoke-command): Delete function.
2021-10-11ccwl: Factorize out CWL generation code to separate file.Arun Isaac
This factorization is required to support other compilation targets such as graphviz, bash, scheme, etc. * ccwl/cwl.scm: New file. * Makefile.am (SOURCES): Register it. * ccwl/ccwl.scm (ccwl): Export command?, command-inputs, command-outputs, command-args, command-stdin, command-other, workflow?, workflow-steps, workflow-inputs, workflow-outputs, workflow-other, input?, input-id, input-type, input-label, input-default, input-position, input-prefix, input-other, output?, output-id, output-type, output-binding, output-source, output-other, step?, step-id, step-run, step-in, step-out, unspecified-default?. (<workflow>): New type. (filter-alist): Move to cwl.scm. (make-workflow): Refactor into workflow->cwl-scm in cwl.scm. (output->cwl): Move to cwl.scm as output->cwl-scm. (command->cwl): Move to cwl.scm as command->cwl-scm. (workflow-steps): Rename to collect-steps. Clarify docstring. (workflow): Use collect-steps instead of workflow-steps. Explicitly pass empty list as other argument of make-workflow. Add TODO note to implement it properly. * scripts/ccwl.in: Import (ccwl cwl) instead of (ccwl yaml). Use workflow->cwl instead of scm->yaml. * tests/ccwl.scm ("stdin input should not have inputBinding"): Use command->cwl-scm from (ccwl cwl) instead of command->cwl from (ccwl ccwl).
2021-10-11ccwl: Remove unused write-cwl function.Arun Isaac
* ccwl/ccwl.scm: Do not export write-cwl. (write-cwl): Delete function.
2021-10-07ccwl: Pass workflow inputs through every command.Arun Isaac
We pass workflow inputs through all commands and constructs (pipe, tee, etc.). Thus, these parameters are globally visible to all steps, and are a kind of "global variable". * ccwl/ccwl.scm (workflow-steps): Pass to the output, input keys that correspond to workflow inputs.
2021-10-06ccwl: Fix the docstring of workflow-steps.Arun Isaac
Before this commit, the docstring of workflow-steps did not correctly describe its function. * ccwl/ccwl.scm (workflow-steps): Fix docstring.
2021-10-04ccwl: Quote source code in error messages.Arun Isaac
This makes it easier to distinct source code from the regular text of the error messages. * ccwl/ccwl.scm (workflow-steps): Quote source code in error messages.
2021-10-04ccwl: Support #:allow-other-keys in lambda** and syntax-lambda**.Arun Isaac
* ccwl/utils.scm (lambda**): Support #:allow-other-keys. Update docstring. (syntax-lambda**): Update docstring. * tests/utils.scm ("Allow other keys in lambda**", "Allow other keys in syntax-lambda**"): New tests.
2021-10-04ccwl: Error out on invalid keywords to lambda**.Arun Isaac
* ccwl/utils.scm (lambda**): Error out on invalid keywords (that is, keywords other than #:key, #:key* and #:allow-other-keys). * tests/utils.scm ("lambda** should error out on unrecognized keywords in arguments"): New test.
2021-10-04Revert "In pipe, pass through input keys to all expressions."Arun Isaac
This reverts commit 35bcaaa67efbe9b60e69b0f7c17acc186c74e7c3. This was not such a good idea. It is better to introduce the notion of global parameters.
2021-08-17ccwl: Define output objects using a macro instead of a function.Arun Isaac
This allows us to do sophisticated syntax checking at an early stage, very close to the user interface. That way error messages from ccwl will make a lot more sense. * ccwl/ccwl.scm (output): Re-implement as macro. (command): Use the new macro interface. * doc/capture-output-file-with-parameter-reference.scm, doc/capture-output-file.scm, doc/capture-stdout.scm, doc/checksum.scm, doc/decompress-compile-run.scm: Use new quoting syntax for output types.
2021-08-16ccwl: Define input objects using a macro instead of a function.Arun Isaac
This allows us to do sophisticated syntax checking at an early stage, very close to the user interface. That way error messages from ccwl will make a lot more sense. * ccwl/ccwl.scm (input): Re-implement as macro. (<input>): Add new functional setters set-input-position and set-input-prefix. (input-spec-id, run-arg-position, run-arg-prefix): New functions. (command, workflow): Use the new macro interface. * doc/capture-output-file-with-parameter-reference.scm, doc/capture-output-file.scm, doc/capture-stdout.scm, doc/checksum.scm, doc/decompress-compile-run.scm, doc/hello-world.scm, doc/pass-stdin.scm: Use new quoting syntax for input types.
2021-07-27ccwl: Make syntax-lambda** more like lambda**.Arun Isaac
I have tripped up several times on the differences between lambda** and syntax-lambda**. No longer! Making syntax-lambda** as close as possible to lambda** makes the code much more readable and align better with common sense. * ccwl/utils.scm (syntax-lambda**): Do not ignore the first identifier. Accept multiple values as arguments, not a single syntax object. * ccwl/ccwl.scm (command): Update use of syntax-lambda**. * tests/utils.scm ("syntax-lambda**", "syntax-lambda** with default values"): Update tests.
2021-07-20ccwl: Do not specify '() as the default value for n-ary arguments.Arun Isaac
Specifying '() as the default value for n-ary arguments is now equivalent to specifying '(()) as the default value. This is wrong. * ccwl/ccwl.scm (command): Do not explicitly specify the emtpy list as the default value for n-ary arguments.
2021-07-20ccwl: Set default value of lambda** n-ary arguments to '().Arun Isaac
* ccwl/utils.scm (lambda**): Set default value of lambda** n-ary arguments to the empty list. Document this in the docstring. * tests/utils.scm ("default value of lambda** unary argument should be #f", "default value of lambda** n-ary argument should be the empty list"): New tests.
2021-07-20ccwl: Document syntax-lambda** support for default arguments.Arun Isaac
* ccwl/utils.scm (syntax-lambda**): Add example to docstring documenting support for default arguments. * tests/utils.scm ("syntax-lambda** with default values"): New test.
2021-07-20ccwl: Clarify difference between and lambda** and syntax-lambda**.Arun Isaac
* ccwl/utils.scm (syntax-lambda**): Clarify difference between and lambda** and syntax-lambda**.
2021-07-20ccwl: Support default values for arguments in lambda**.Arun Isaac
* ccwl/utils.scm (lambda**): Support default values for arguments, both unary and n-ary. * tests/utils.scm ("lambda** with default values"): New test.
2021-07-20ccwl: Add examples to docstrings.Arun Isaac
* ccwl/utils.scm (pairify, plist->alist, group-keyword-arguments, plist-ref, syntax-lambda**, filter-mapi, mapn, append-mapn, foldn): Add examples to docstrings.
2021-07-19ccwl: Add missing syntax in unsyntax-keywords docstring example.Arun Isaac
* ccwl/utils.scm (unsyntax-keywords): Add missing syntax in docstring example.
2021-07-05ccwl: Remove extra blank lines.Arun Isaac
* ccwl/ccwl.scm: Remove extra blank lines.
2021-07-03doc: Move skribilo configuration into doc directory.Arun Isaac
* ccwl/skribilo.scm: Move to ... * doc/skribilo.scm: ... here. * doc/ccwl.skb: Import (doc skribilo) instead of (ccwl skribilo). * Makefile.am ($(SKRIBILO_BUILD_DIR)/ccwl.info, $(SKRIBILO_BUILD_DIR)/ccwl.html): Depend on doc/skribilo.go instead of ccwl/skribilo.go. * Makefile.am (clean-local): Delete doc/skribilo.go instead of ccwl/skribilo.go.