-
Notifications
You must be signed in to change notification settings - Fork 44
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
Feature request: a non-crashing modulo operation #113
Comments
This does make a very significant difference from the efficiency perspective. For the following program:
I have:
Changing
|
BTW, "executing" anything in a circuit (the proving phase) is extremely slow. In the first version above we're just doing 100 divisions and this takes over 7s to prove. ENIAC could execute 35 divisions per second. |
Sorry if this came out as disrespectful, this was not at all my intention. I well realize that there are more things going on in the circuit than just doing divisions. My point is that if you want to compile from a higher-level language that is not close to the circuit model, and you just want to do say 100 integer divisions (not field element divisions) in that higher-level language, then in the actual circuit, as you point out, you'll be doing lots of other things. But the high-level user cares about the 100 integer division, which if compiled to native machine instructions would roughly be dominated by doing 100 division instructions. I'm sorry again if this was read as criticism of VampIR, which it is not. It was meant as a general comment on the difficulty of creating an efficient circuit from a high-level language, with proving/"executing" efficiency comparable to what one would achieve with even a direct interpreter. This is what I'm concerned with all the time. And indeed I have been a bit frustrated by my inability to achieve such efficiency, but this is not a criticism of VampIR, just my general comment on the situation. You're right that I should've perhaps provided more context and phrased this comment differently, but there is no need to assume malice on my part. |
I realized my original comment was a bit hostile, and I didn't understand what you were trying to communicate. I accept your apology and offer mine in return. |
Following the discussion in #107, it would be very useful to have a version of
%
analogous to|
which returns 0 instead of crashing when the second argument is 0. The alternative of implementing modulo bitwise using available primitives would have a significant impact on the efficiency of VampIR code generated from Juvix programs.The text was updated successfully, but these errors were encountered: