-
Notifications
You must be signed in to change notification settings - Fork 80
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
Field for jit #1834
Field for jit #1834
Conversation
15d13a0
to
2b28c25
Compare
2b28c25
to
3e9c60e
Compare
let f = compile( | ||
" | ||
namespace std::array; | ||
let len = 8; |
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.
What does len
do in here?
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.
Is this the degree of the main?
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 std::array::len
. It needs to be there, otherwise it is not found when it's used. The value does not matter because it's a built-in and is overwritten.
#![allow(unused_parens)] | ||
|
||
#[derive(Clone, Copy)] | ||
struct FieldElement(u64); |
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.
Why do we define it from scratch, instead of using the implementation we already have? Would it take too long to compile? Is there a plan to support larger fields?
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.
There are several possibilities, but I first wanted to check if JIT compilation is feasible at all. With the crate we currently use, it takes sooo much longer. Also, for the JIT it would be sufficient to use a crate that only supports one specific field, while our current number create supports all fields that we currently have.
The first milestone is being able to evaluate array expressions efficiently. For that, we do not need arithmetic on field elements.
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.
LGTM
Very basic support for the
fe
type. It only supports up to 64 bits and no operations on the field element.