Hello,
I did some reading on the Chapel language specifications to understand
the begin statement (This actually helped me better understand the
problem description).
I have a few questions regarding begin expressions:
(1) Since chapel is not a functional language, functions can have
side-effects (e.g change global variables - [any shared memory in the
context of this question]). Using such functions in begin expressions
might lead to concurrency issues such as race conditions.
e.g:
var x : int = 5;
proc funA(y:int) : int {
x += 1;
return x + y;
}
proc funB(y:int) : int {
x += 2;
return x+y;
}
var z = begin funA(10) + begin funB(15);
This problem can also arise due to call by reference function calls
(when both functions attempt to modify the parameter).
Unless the functions are written to enforce mutual exclusion, these
kind of calls will be disastrous.
Any ideas how we can handle this ? (The problem description also
includes a bonus result probably because of this complication. I
believe the runtime library functions are not thread-safe ?)
(2) Currently it is illegal to include a return statement in the begin
statement [1]. This issue can be resolved in two ways :
(a) By lifting this restriction on begin statements or (b) by treating
begin expressions as different grammatical constructs (in some sense
"begin" keyword would then be overloaded). I am not sure how (a) will
affect the language, but (b) is a safer option.
(3) I wonder what implications this feature have on the Common
Sub-expression compiler optimization pass. It is not always possible
to determine if two begin expressions will produce the same output
even if they have the exact same function calls.
I would like to know your opinion about my thoughts.
Thank you,
Rajath Shashidhara
[1] Section 24.2 http://chapel.cray.com/spec/spec-0.98.pdf
On Thu, Mar 3, 2016 at 12:21 AM, Rajath Shashidhara
<[email protected]> wrote:
> Hello,
>
> I have perused your ideas page and I would love to work on
> implementing support for begin expressions in Chapel.
>
> During the course of my academics, I have developed an interest in the
> development of scalable and performance critical software. I am
> familiar with the parallel and distributed programming paradigms and
> frameworks. I have worked on several programming and design projects
> in this domain. This project would help me further my experience in
> this area.
>
> I am good at adapting to new technologies, frameworks or languages and
> I have experience in open source contribution (including GSoC'13 with
> Apache OpenOffice).
>
> I would like to know more about begin expressions (expected semantics
> and syntax). Meanwhile, I will familiarize myself with source code and
> architecture of Chapel compiler. It would be great if you could
> suggest me a bug that will expose me to the relevant source code.
>
> Thank you,
> Rajath Shashidhara
>
> Attachments :
> [1] Resume : https://drive.google.com/open?id=0ByDeY7btIDOWR25sa3lpMExWU0U
> [2] Github : https://github.com/rajaths589
------------------------------------------------------------------------------
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers