[Swift-devel] returning primitive values from apps

Mihael Hategan hategan at mcs.anl.gov
Tue Sep 17 11:35:38 CDT 2013


Hi Mark,

Sadly, not much.

Ketan, a while ago, mentioned that he would like to see something of the
form:

app (<type> value) f() {
   f stdout = filename(value);
}

I complained that the idea of filename() on a primitive type would be
confusing. But then it just occurred to me that the idea of "stdout = "
is also confusing.

So it might be that we could have something like this:

f stdout > value;

If value is a file type, this would be interpreted as what today we
would express as stdout = filename(value), except in a more natural form
if you come from shell scripting.

It would also then make sense to use that for primitive types and
"compile" it to something like value =
readData(someFileThatHasTheStdoutOfTheProcess).

I'm not sure how to extend this to non-stdout/err things. The only other
standard way to communicate with a process is through command line
parameters. We use those sometimes to supply the app input and output
file names, but how we would make it such that primitive values go
through a file and the scheme is expressed in a way that makes it
unambiguous for the user to tell what it means, that I'm not quite sure
of.

Perhaps something more explicit might work:

app (int r1, int r2) f(int p1, int p2) {
   file tmpr1, tmpr2, tmpp1, tmpp2;
   p1 > tmpp1;
   p2 > tmpp2;
   f @tmpp1 @tmpp2 @tmpr1 @tmpr2;
   r1 < tmpr1;
   r2 < tmpr2;
}

Mihael

On Tue, 2013-09-17 at 11:10 -0500, Mark Hereld wrote:
> do you have a list of candidate syntax ideas for this?
> -mark
> 
> On Sep 17, 2013, at 10:37 AM, Mihael Hategan <hategan at mcs.anl.gov> wrote:
> 
> > I'm in favor of the idea too, but I think we need a discussion about how
> > it will look like in the language and how it would look like to a user.
> > 
> > Mihael
> > 
> > On Tue, 2013-09-17 at 09:28 -0500, Ketan Maheshwari wrote:
> >> I am in favor of this feature. Mike's suggestion of built-in ReadData logic
> >> in app invocation routine sounds like a good idea.
> >> 
> >> 
> >> On Mon, Sep 16, 2013 at 10:26 PM, Mihael Hategan <hategan at mcs.anl.gov>wrote:
> >> 
> >>> Please take a look at
> >>> https://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=293
> >>> 
> >>> I think we should discuss it.
> >>> 
> >>> Mihael
> >>> 
> >>> _______________________________________________
> >>> Swift-devel mailing list
> >>> Swift-devel at ci.uchicago.edu
> >>> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel
> >>> 
> >> 
> > 
> > 
> > _______________________________________________
> > Swift-devel mailing list
> > Swift-devel at ci.uchicago.edu
> > https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel
> 
> -------------------------------------------------------
> Mark Hereld <hereld at anl.gov>
> Senior Fellow - Computation Institute 
> Experimental Systems Engineer - Mathematics and Computer Science
> Visualization and Analysis Lead - Argonne Leadership Computing Facility
> Argonne National Laboratory
> The University of Chicago
> 
> Cell: 630.327.2088
> Voice: 630.252.4170
> 
> 
> 
> 
> 
> 
> 
> do you have a list of candidate syntax ideas for this?
> -mark
> 
> On Sep 17, 2013, at 10:37 AM, Mihael Hategan <hategan at mcs.anl.gov>
> wrote:
> 
> > I'm in favor of the idea too, but I think we need a discussion about
> > how
> > it will look like in the language and how it would look like to a
> > user.
> > 
> > Mihael
> > 
> > On Tue, 2013-09-17 at 09:28 -0500, Ketan Maheshwari wrote:
> > > I am in favor of this feature. Mike's suggestion of built-in
> > > ReadData logic
> > > in app invocation routine sounds like a good idea.
> > > 
> > > 
> > > On Mon, Sep 16, 2013 at 10:26 PM, Mihael Hategan
> > > <hategan at mcs.anl.gov>wrote:
> > > 
> > > > Please take a look at
> > > > https://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=293
> > > > 
> > > > I think we should discuss it.
> > > > 
> > > > Mihael
> > > > 
> > > > _______________________________________________
> > > > Swift-devel mailing list
> > > > Swift-devel at ci.uchicago.edu
> > > > https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel
> > > > 
> > > 
> > 
> > 
> > _______________________________________________
> > Swift-devel mailing list
> > Swift-devel at ci.uchicago.edu
> > https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel
> 
> -------------------------------------------------------
> Mark Hereld <hereld at anl.gov>
> Senior Fellow - Computation Institute 
> Experimental Systems Engineer - Mathematics and Computer Science
> Visualization and Analysis Lead - Argonne Leadership Computing
> Facility
> Argonne National Laboratory
> The University of Chicago
> 
> 
> Cell: 630.327.2088
> Voice: 630.252.4170
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 





More information about the Swift-devel mailing list