gwl-devel
[Top][All Lists]
Advanced

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

Re: [gwl-devel] merging “processes” and “restrictions”


From: Ricardo Wurmus
Subject: Re: [gwl-devel] merging “processes” and “restrictions”
Date: Sat, 19 Jan 2019 21:51:40 +0100
User-agent: mu4e 1.0; emacs 26.1

zimoun <address@hidden> 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 via email to

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