-
Notifications
You must be signed in to change notification settings - Fork 9
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
bytecode: Implement addition and subtraction #274
Conversation
firebase-deployment for ece2f03 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me just a couple of comments, mostly food for thought.
I'll wait for @camh- if he's got anything to add again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly comments around tests - I'm sorry I didn't get around to reviewing the tests last time, some of this I could have picked up then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed most issues, some outstanding conversations to follow up on.
What do we think of unifying vm_test and compiler_test? The inputs and test cases are the same and vm_test runs the compiler - would this simplify or complicate things?
8070f56
to
c581041
Compare
c581041
to
311e00f
Compare
Agree 100%. I was going to comment on this but felt I had said enough already. I'm glad you brought it up. This is what we've done elsewhere - more of end-to-end testing that unit testing. As you point out, the test cases are the same and they will surface the same errors. If you plan to keep the compiler and vm in the same package, this is easy since it is logically valid to have a single test that covers both. I originally had a mental model of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have:
- merged the tests into vm_test
- set operand widths to nil instead of empty slice
- refactored the vm to use panics instead of errors and added ErrInternal
- changed the binary expression handling to avoid helper methods
- changed numVal to be a float64 (in doing so I had to remove Set because you can't have a pointer receiver on a float64, I think this is ok because you can now just write
a = numVal(12)
to reset the value)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks pretty solid to me. Just a little bit around error grouping
sentinel errors.
All of this is foundational work for the bytecode
package and this back and forth will hopefully soon drop away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i'm happy with this - Thank You - there is only one last unresolved comment:
#274 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, this is all good from my end now, but maybe @camh- has still something else to add? I'll leave it up to him.
Also, if you can please squash all fix-ups.
7480a03
to
ece2f03
Compare
These simple operations for integer mathematics will be expanded upon in the next change, which will add the multiplication, division and modulo operations. This change also standardises the compiler and vm test layouts to increase their readability. Co-authored-by: joshcarp <[email protected]> Co-authored-by: pgmitche <[email protected]>
This change follows on from #274 by adding compiler support for the remaining mathematical operators in evy. The compiler must also understand the `parser.GroupExpression` to expand expressions inside parenthesis. Co-authored-by: joshcarp [email protected] Co-authored-by: pgmitche [email protected]
This change follows on from #274 by adding compiler support for the remaining mathematical operators in evy. The compiler must also understand the `parser.GroupExpression` to expand expressions inside parenthesis. Co-authored-by: joshcarp <[email protected]> Co-authored-by: pgmitche <[email protected]>
This change follows on from #274 by adding compiler support for the remaining mathematical operators in evy. The compiler must also understand the `parser.GroupExpression` to expand expressions inside parenthesis. Co-authored-by: joshcarp <[email protected]> Co-authored-by: pgmitche <[email protected]>
This change follows on from #274 by adding compiler support for the remaining mathematical operators in evy. The compiler must also understand the `parser.GroupExpression` to expand expressions inside parenthesis. Co-authored-by: joshcarp <[email protected]> Co-authored-by: pgmitche <[email protected]> Pull-request: #277
These simple operations for integer mathematics will
be expanded upon in the next change, which will add
the multiplication, division and modulo operations.
This change also standardises the compiler and vm test
layouts to increase their readability.
Co-authored-by: joshcarp [email protected]
Co-authored-by: pgmitche [email protected]