-
Notifications
You must be signed in to change notification settings - Fork 39
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
Split Ruby code to match other languages #67
Conversation
* require/require_relative raise LoadError if they cannott load the file.
* The difference is trivial and easily checked for.
* Same structure as in Python and Java. * Makes it easy to not load harness.rb.
70845b3
to
707bb75
Compare
@smarr In CD, RuboCop is suggesting to change: # Y is guaranteed to be non-null at this point.
if y.left
x = y.left
else
x = y.right
end to # Y is guaranteed to be non-null at this point.
x = y.left || y.right I do that, or I add an ignore? (it is semantically equivalent, it avoids calling |
707bb75
to
6f127b3
Compare
Hm, my feeling is that we would want a compiler to figure this out. So, I'd tent to disabling the relevant rubocop rule. |
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.
Just for confirmation, this is just moving code around right?
@boris-spas mentioned in Potsdam that he indeed wanted to do that to replicate the same code structure as in the other languages.
So, yeah, that's great.
Thanks
Mostly, yes. If you review commit-by-commit it's clearer what happens and what are the actual changes. |
@boris-spas will double-check it works for polybench and then it should be ready to merged (that's why it's a draft PR currently). |
LGTM! Polybench happily works with require(PATH_TO_AWFY_BENCHMARKS_RUBY + "/run")
RUN = Run.new('Bounce')
RUN.num_iterations = 1
RUN.inner_iterations = 1
def run()
RUN.run_benchmark
end |
Ready to be merged then |
Thank you! |
This is needed to integrate with polybench, cc @boris-spas.
Notably this makes it possible to run a benchmark without needing to run harness.rb, like: