From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:44565) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyCMy-0005GU-08 for gwl-devel@gnu.org; Sun, 02 Feb 2020 05:20:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iyCMw-0008AR-O6 for gwl-devel@gnu.org; Sun, 02 Feb 2020 05:20:47 -0500 Received: from sender4-of-o51.zoho.com ([136.143.188.51]:21128) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iyCMv-000862-P5 for gwl-devel@gnu.org; Sun, 02 Feb 2020 05:20:46 -0500 From: Ricardo Wurmus Subject: Comments on process template syntax Date: Sun, 02 Feb 2020 11:20:36 +0100 Message-ID: <871rrdthmz.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gwl-devel-bounces+kyle=kyleam.com@gnu.org Sender: "gwl-devel" To: gwl-devel@gnu.org 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 =E2=80=9Clist-file-template= =E2=80=9D that returns a process parameterized on the argument =E2=80=9Cfilename=E2=80=9D. 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 =E2=80=9Ctem= plate case=E2=80=9D 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 =E2=80=9Cprocess:=E2=80=9D macro to just =E2=80=9Cproc= ess=E2=80=9D to remove confusing syntactic noise, so anything about the first line may be changed.) -- Ricardo