I am soliciting suggestions for generalizing the current syntax for task 
intent clauses.

* What is a task intent clause?

It allows the user to list the variables to be treated specially w.r.t. 
task intents. E.g. if 'i' is defined outside a 'begin' and used inside 
it, then 'ref i' indicates that 'i' is to be passed by reference into 
the begin task function. Otherwise 'i' is passed by blank intent.

   var i = 5;
   begin i = 6;        // illegal - 'i' is constant within the begin
   begin ref(i) i = 6; // legal; updates the original 'i'

See Section 24.7 "Task Intents" in the Chapel Spec.

* Why generalizing?

Currently only 'ref' can be specified in a task intent clause. We would 
like to support other intents, for example 'in'.

* What are the issues?
   Or, why can't we generalize the current syntax in a straightforward way?


  - Allowing 'in' for the coforall loop, the way we currently allow 
'ref', makes it ambiguous at least syntactically, perhaps also visually, 
e.g.:

      coforall a in (b) { ... }

    Is 'a' the index variable and 'b' a no-paren iterator (a call to 
which is wrapped in parens)? Or is 'a' a no-paren iterator and 'in(b)' a 
task intent clause?


  - We are about to introduce ref variables, declared using 'ref' 
instead of 'var'. This is syntactically ambiguous with the current task 
intent clause:

      begin ref(i,j) ...

    The parser can't tell whether ref(i,j) are a task intent clause or a 
declaration of two reference variables.


  - It would be nice to have a task intent clause remind a list of 
formal arguments. However, the simple solution is also syntactically 
ambiguous:

      begin ( a.b; )
      begin ( ref c, in d ) { ... }

    The parser can't tell whether the left paren starts a parenthesized 
expression or a argument-list-like task intent clause. This is perhaps a 
consequence of building the parser with bison.


Suggestions?

P.S.1. Kyle B. and I have worked out a proposal. I'd like to let others 
take a shot at it before circulating ours.

P.S.2. We are working on applying task intents to 'forall' statements. 
The task intent clauses in foralls will be available using the same 
syntax as coforalls.

Vass

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to