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

Logical Operators #34

Closed
ballercat opened this issue Dec 18, 2017 · 0 comments
Closed

Logical Operators #34

ballercat opened this issue Dec 18, 2017 · 0 comments
Assignees
Milestone

Comments

@ballercat
Copy link
Owner

Goal

We should have logical operator support

Overview

Some research needs to be done on how to best encode these

I'm actually not 100% on what the best implementation approach should be here. There are no native logical operators in wasm, probably because it's just all bitwise &s and |s. Problem is, logical operators have a different semantic from binary ops in most language.

const a: i32 = maybeThis() || maybeThat(); encoded into a bitwise or is not enough here. Probably means that logical operators need to be encoded as blocks that return a value.

Acceptance Criteria

  • Support binary logical operators
  • Logical ops should return one of the operands
  • Support short-circuiting
  • Test the world
  • Tests pass
@ballercat ballercat added this to the Alpha milestone Dec 18, 2017
@ballercat ballercat self-assigned this Dec 19, 2017
ballercat added a commit that referenced this issue Dec 24, 2017
Implement #34
Fix #40
Fix(pretty sure) if/then regression mentioned in #38
Add coverage
Add gitter badge
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

1 participant