From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gkxbB-0004jI-Vj for mharc-gwl-devel@gnu.org; Sat, 19 Jan 2019 15:52:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkxbA-0004iB-8e for gwl-devel@gnu.org; Sat, 19 Jan 2019 15:52:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gkxb9-0006yN-DT for gwl-devel@gnu.org; Sat, 19 Jan 2019 15:52:12 -0500 Received: from sender-of-o53.zoho.com ([135.84.80.218]:21788) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gkxb9-0006pL-19 for gwl-devel@gnu.org; Sat, 19 Jan 2019 15:52:11 -0500 References: <87bm4df2ld.fsf@elephly.net> <878szgg9bi.fsf@elephly.net> From: Ricardo Wurmus In-reply-to: Date: Sat, 19 Jan 2019 21:51:40 +0100 Message-ID: <871s58fk0z.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: =?UTF-8?B?UmU6IG1lcmdpbmcg4oCccHJvY2Vzc2Vz4oCdIGFuZCDigJxyZXN0?= =?UTF-8?B?cmljdGlvbnPigJ0=?= List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: zimoun Cc: gwl-devel@gnu.org zimoun writes: >> I=E2=80=99d like this to be a short name if possible. In fact, I=E2=80= =99d prefer if it >> was completely invisible like this: >> >> (workflow >> (name "simple") >> (processes >> ((eat "fruit") -> greet) >> ((eat "veges") -> greet) >> (sleep -> (eat "fruit") (eat "veges")) >> (bye -> sleep))) > > Is it possible invisible? Sure, it just requires more macrology. >> Or like this assuming that all of the processes declare inputs and >> outputs *somehow*: >> >> (workflow >> (name "simple") >> (processes >> (eat "fruit") (eat "veges") greet sleep bye)) > > With this, I do not see how the graph could be deduced; without > specifying the inputs-outputs relationship and without specifying the > processes relationship. This will only work if these processes declare inputs and outputs and they can be matched up. Otherwise all of these processes would be deemed independent. I still wonder how processes should declare inputs. The easiest and possibly least useful way I can think of is to have them declare abstract symbols. --8<---------------cut here---------------start------------->8--- (process: 'bake (data-inputs '(flour eggs)) (procedure '(display "baking")) (outputs '(cake))) (process: fry (data-inputs '(flour eggs)) (procedure '(display "frying")) (outputs '(pancake))) (process: (take thing) (procedure '(format #t "taking ~a." thing)) (outputs (list thing))) (workflow: dinner (processes (list (take 'flour) (take 'eggs) fry bake))) --8<---------------cut here---------------end--------------->8--- Here all of the dinner processes have outputs: (map process-outputs (workflow-processes dinner) =3D> (list 'flour 'eggs 'pancake 'cake) And here are the inputs: (map process-data-inputs (workflow-processes dinner) =3D> (list #f #f '(flour eggs) '(flour eggs)) Given this information we can deduce the adjacency list: (graph (fry -> (take 'flour) (take 'eggs)) (bake -> (take 'flour) (take 'eggs))) In this case =E2=80=9Coutputs=E2=80=9D would mean =E2=80=9Cprovides=E2=80= =9D, and =E2=80=9Cdata-inputs=E2=80=9D would be =E2=80=9Crequires=E2=80=9D. There could be more than one process =E2=80=9C= providing=E2=80=9D a certain kind of output. I=E2=80=99m not sure how useful this is as a *generic* mechanism, though. = One could also use this as a very specific mechanism, for example to have a process declare that it outputs a certain file, and another that it takes this very same file as an input. (I don=E2=80=99t know how this would relate to the content addressable data store. Maybe it doesn=E2=80=99t at all.) -- Ricardo