Hi Vassily,
I have examined the reference material as per your suggestion.
Before I start writing the application, I would like to find answers
to a few more questions (I have added my comments below each
question)-
[1] Why is the module "Futures" referenced in the mail above not used
currently ?
Are there any particular flaws in this module ? This will help me
identify the pitfalls and understand how my implementation must be
different from it.
[2] Is there any reason behind why "single" qualifier is not supported
for record types ?
i.e., Is it not implemented or is it not supported deliberately for
some reason ?
[3] What work needs to be done on the run-time library for begin
expressions support ?
As Michael has stated in the previous mail, the library is
thread-safe. If thread-safety is not the problem, I can't think of any
other problem.
[4] Can begin expressions contain blocks ? i.e., a = begin {z=fn(b);
fn1(z)} + begin fn(c);
Although this makes the code clumsy, it is useful in certain
cases where the user otherwise will have to create a wrapper function.
The same functionality can be achieved by creating a new function
fn2(b) { z=fn(b); return fn1(z); } and a = begin fn2(b) + begin fn(c);
(Note that z can be a global variable).
In case the fn2 is not reused multiple times in the program, the user
can avoid creating such wrapper functions.
The return value of the last statement in the begin block can be used
as the value to used in the expression.
Aside:
Is there a way to print the AST produced by the compiler ?
I am sorry for the delayed response to your mail. I was busy with my exams.
Thank you,
Rajath Shashidhara
On Thu, Mar 10, 2016 at 10:30 AM, Vassily Litvinov <[email protected]> wrote:
> Hi Rajath,
>
> I hope that Michael's responses to your questions make sense. It is great to
> see that you are started digging into the project. As a mentor for this
> project, I would like to suggest a couple of additional things you could try
> out.
>
> Implement begin expressions "by hand", i.e. by manually converting a Chapel
> program with begin expressions to one that compiles today.
>
> For example, you would convert a statement containing:
>
> ... begin f(args) ...
>
> to several statements like this:
>
> var temp$: single int; // or whatever f() return type is
> begin temp$ = f(args);
> ... temp$ ...
>
> Write a simple program with begin expressions or use example(s)
> from the overview email below, and apply such conversion to them.
>
> As the next step, support the case where f() return type is a record R,
> so you cannot declare temp$ to be a "single" variable.
> Instead, develop a scheme like in the overview email below,
> except without using lambdas.
>
>
> Here are some resources.
>
> * There is an earlier implementation of begin expressions, a.k.a. "futures".
> Some of its valuable pieces are an overview email:
>
> https://sourceforge.net/p/chapel/mailman/message/30815892/
>
> and examples, esp. hello-world.chpl, fib.chpl, smith-waterman.chpl - here:
>
>
> https://github.com/chapel-lang/chapel-attic/tree/eec5ad5/test/release/examples/futures
>
> Beware that these examples are no longer available via the link provided
> in the above email message.
>
> * "Futures" in C11 - background - we probably take a different approach -
> e.g.:
>
>
> https://code.facebook.com/posts/1661982097368498/futures-for-c-11-at-facebook/
>
>
> Be sure to let me know if you have questions.
>
> Vassily
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers