unofficial mirror of gwl-devel@gnu.org
 help / color / mirror / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: zimoun <zimon.toutoune@gmail.com>
Cc: gwl-devel@gnu.org
Subject: Re: merging “processes” and “restrictions”
Date: Sat, 19 Jan 2019 21:51:40 +0100	[thread overview]
Message-ID: <871s58fk0z.fsf@elephly.net> (raw)
In-Reply-To: <CAJ3okZ1Yt_F=CqX5SmZ7e0O1F_TXvm8X1ahVHnvqOTf0uc+DbA@mail.gmail.com>


zimoun <zimon.toutoune@gmail.com> writes:

>> I’d like this to be a short name if possible.  In fact, I’d 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)
  => (list 'flour 'eggs 'pancake 'cake)

And here are the inputs:

  (map process-data-inputs (workflow-processes dinner)
  => (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 “outputs” would mean “provides”, and “data-inputs” would be
“requires”.  There could be more than one process “providing” a certain
kind of output.

I’m 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’t know how this would relate to the content addressable data
store.  Maybe it doesn’t at all.)

--
Ricardo

  reply	other threads:[~2019-01-19 20:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-19  8:55 merging “processes” and “restrictions” Ricardo Wurmus
2019-01-19 10:26 ` zimoun
2019-01-19 11:45   ` Ricardo Wurmus
2019-01-19 17:55     ` zimoun
2019-01-19 20:51       ` Ricardo Wurmus [this message]
2019-01-21 18:45         ` zimoun
2019-01-21 22:51           ` Ricardo Wurmus
2019-01-22  8:49             ` zimoun
2019-01-21 14:43     ` Ricardo Wurmus
2019-01-21 18:53       ` zimoun
2019-01-21 15:32     ` Ricardo Wurmus
2019-01-21 18:55       ` zimoun
2019-01-21 19:33       ` Ricardo Wurmus
2019-01-21 19:59         ` zimoun
2019-01-26 21:49           ` Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.guixwl.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871s58fk0z.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=gwl-devel@gnu.org \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).