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

Add Parsing of Modifer Operators (e.g. +=) to Luna #312

Closed
iamrecursion opened this issue Oct 15, 2018 · 5 comments
Closed

Add Parsing of Modifer Operators (e.g. +=) to Luna #312

iamrecursion opened this issue Oct 15, 2018 · 5 comments
Assignees
Labels
p-highest Should be completed ASAP

Comments

@iamrecursion
Copy link
Contributor

iamrecursion commented Oct 15, 2018

Summary

Currently CI is failing due to the inability of Luna to parse operators used in StdTest. This task exists to track the implementation of modifier operators into the parser and IR.

Value

Modifier operators are potentially useful functionality for our users, but this is also keeping CI in the red, reducing the availability of valuable feedback to team members.

Specification

  • Design IR for such operators (either raw or as a desugaring).
  • Implement IR for these operators.
  • Implement parsing for such operators in the parser.

Acceptance Criteria & Test Cases

  • Luna successfully parses modifier operators into valid IR.
  • StdTest passes on CI with the FieldModifications test enabled.
@iamrecursion
Copy link
Contributor Author

An additional example of this breakage is in #368.

@iamrecursion
Copy link
Contributor Author

#355 is also this same bug.

@iamrecursion
Copy link
Contributor Author

A big issue with this is that it's currently breaking the ability to have a simple != or /= not-equal-to operator work.

@iamrecursion iamrecursion added p-highest Should be completed ASAP and removed P - TBC labels Mar 4, 2019
@wdanilo
Copy link
Member

wdanilo commented Mar 6, 2019

Continuing the discussion from here (https://github.com/luna/luna/issues/368) :

@mwu-tow == is not a valid case here as the = is already a special kind of an operator and having a modifier == would not make sense.

@iamrecursion I would rather not special case something. There are many other options possible / questions involved:

  • Should we allow for prefix operators? I know that not operator would be cool, but we've got an incredibly small amount of use cases for them so far, so maybe its better to go the Haskell way here (this is still an open discussion and we need to finish it soon)
  • Should ! be the negate operator? Why not ~? From a mathematical perspective, it's much more valid to use ~ for that purpose. Moreover, we were planning to use ! as a syntax for possible errors like, foo : Int in IO ! IOErrror. Then it would be compatible with !=, as there would not be an ! operator.

@iamrecursion
Copy link
Contributor Author

We can perhaps sidestep the question about prefix operators for now, we do need some construct for expressing ‘not equal to’ that doesn’t run afoul of this field modifiers issue.

While actually implementing field modifications is important it, in my view, is not as high priority is unbreaking the ability to express !=, whatever the chosen syntax is.

Field modifications themselves are a touch more complicated as they require interpreter support which doesn’t yet exist, but will as part of the new interpreter. I do believe, however, that we haven’t decided the semantics of field modification, or if we have that it isn’t written down anywhere.

@joenash joenash closed this as completed Jun 23, 2020
@iamrecursion iamrecursion mentioned this issue Jun 23, 2020
26 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p-highest Should be completed ASAP
Projects
None yet
Development

No branches or pull requests

3 participants