gwl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Comments on process template syntax


From: Ricardo Wurmus
Subject: Comments on process template syntax
Date: Sun, 02 Feb 2020 11:20:36 +0100
User-agent: mu4e 1.2.0; emacs 26.3

Hi,

While looking at the examples at https://www.guixwl.org/beyond-started,
I found that process templates might be difficult to understand, and
that they have no pretty syntax.

--8<---------------cut here---------------start------------->8---
process: (list-file-template filename)
  name
    string-append "list-file-"
                  basename filename
  packages "gzip"
  inputs filename
  outputs
    string-append filename ".list"
  run-time
    complexity
      space 20 mebibytes
      time  30 seconds
  # { gzip --list {{inputs}} > {{outputs}} }
--8<---------------cut here---------------end--------------->8---

The first line is easy to understand for lispers but it might look weird
to people who come from other workflow languages or programming
languages.  This describes a procedure called “list-file-template” that
returns a process parameterized on the argument “filename”.

Nextflow has no concept of procedures that produce processes when given
arguments.  It does however have a concept of data streams that can be
fed into processes, which results in a process to be instantiated for
every element of the stream.  The stream may be created from a directory
containing files.

This implementation likely stems from the realization that the “template
case” is the most common case for processes.  Rarely ever is it
necessary to define a process that does *not* require parameterization
on its inputs.

Can we make the common case simpler and easier to understand?  (FWIW, I
intend to rename the “process:” macro to just “process” to remove
confusing syntactic noise, so anything about the first line may be
changed.)

--
Ricardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]