Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semantic checks #84

Open
ggevay opened this issue Oct 18, 2015 · 2 comments
Open

Semantic checks #84

ggevay opened this issue Oct 18, 2015 · 2 comments
Assignees

Comments

@ggevay
Copy link
Contributor

ggevay commented Oct 18, 2015

This is an umbrella issue for cases when it is possible to write some code where it isn't clear semantically what should it do. These cases should be dealt with by either clearly defining what they do, or disallowing them. The latter means adding a semantic check to the native API and/or parallelize that detects the problem, and prints a helpful error message that explains the situation to the user.

@ggevay
Copy link
Contributor Author

ggevay commented Oct 18, 2015

The first example is accessing a stateful with a .bag() call from inside the UDF of an updateWith* call on it. It is not clear whether the user

  • wants to get the old state (from before the updateWithMany call), or
  • wants to see the effect of (maybe some of the) other UDF invocations, within the same updateWith* call.

This confusing situation should be avoided by disallowing this:
the native API could set some flag on the stateful for the duration of an updateWith* call, and check this flag in .bag() and throw an exception;
parallelize could detect this at compile time (eg. in ComprehensionAnalysis.comprehend, when creating an updateWith* combinator).

@joroKr21
Copy link
Member

We can also check for methods / functions that take and / or return DataBags and issue warnings. We should also think about how to solve this problem in the future (e.g. inlining, macro annotations).

@aalexandrov aalexandrov modified the milestones: Nov 2015, Dec 2015 Dec 1, 2015
@aalexandrov aalexandrov modified the milestones: Dec 2015, Jan 2016 Jan 6, 2016
@akunft akunft closed this as completed in 98a588d Jan 13, 2016
aalexandrov pushed a commit that referenced this issue Jan 13, 2016
…sing scope (includes writes to outer mutables and unstable function / method application)

closes #84
@akunft akunft reopened this Jan 14, 2016
@aalexandrov aalexandrov modified the milestones: Jan 2016, Mar 2016 Feb 26, 2016
@aalexandrov aalexandrov modified the milestones: Mar 2016, Apr 2016 Apr 4, 2016
@aalexandrov aalexandrov modified the milestone: Apr 2016 Apr 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants