-
Notifications
You must be signed in to change notification settings - Fork 29
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
feat: add is-prime example #420
Conversation
```bash | ||
midenc run target/miden/release/is_prime.masp --inputs inputs.toml | ||
``` |
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.
This is just executes the program (rather than execute & prove), right?
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.
Yes, midenc run
only executes the program and does not generate a proof. Since comparing our performance to other VMs would be a frequent case, should we add a command to midenc
to execute and generate a proof?
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.
We could do this, but I wonder if it may be better to just add support for working with .masp
files in miden-vm
. It should be simple enough and wouldn't require re-implementing a bunch of other functionality here (e.g., analyze
, debug
, etc. commands).
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.
Yeah, my preference would be to support Miden packages in the VM proper, the need for midenc run
is basically one of temporary necessity.
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.
Looking great! Thank you very much! Just a minor nit.
f8054f6
to
edd7c9a
Compare
The requested change has been resolved
Adding a basic example of computing wether or not an integer is prime or not. I tested the function with values from this website: https://www.math.utah.edu/~pa/MDS/primes.html
For comparison, I tried running SP1's example for proving if the number$$29$$ is prime or not.
top
said my CPU usage was 1000%. After a few minutes of the program running and the fans turning on my MBP M2, I decided to kill the program.Using the Miden compiler, proving that the number$$2147482583$$ is prime is near instant on the same computer.