-
Notifications
You must be signed in to change notification settings - Fork 23
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
(WIP) feat: compiler #71
base: main
Are you sure you want to change the base?
Conversation
@lonerapier Do you want to chat about this at all? It's brainworming me at the moment. Maybe we could cook together? |
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.
absolutely love this direction. API based DSL will save a lot of errors that arise due to language parsing, and it's so easy to extend than separate language as in #60.
@Autoparallel would love to help in any way possible.
src/compiler/mod.rs
Outdated
|
||
pub mod dsl; | ||
|
||
pub struct Wire { |
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.
how will wires have input and output? maybe a better name could be Constraint
?
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.
oh yeah, that is better. I think I was trippin'
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.
Actually, the input
and output
here were going to be the gates or inputs this wire was connected to.
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.
Oh, got it. I got confused then. I remember previously it was names as Connection
Maybe that made more sense? IDK, i'll let you cook.
src/compiler/mod.rs
Outdated
} | ||
|
||
pub struct Circuit { | ||
pub gates: DiGraph<Gate, Wire>, |
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.
maybe instead of picturing a circuit as graph, a simple tuple of (Gate, Constraint) that extends to rows and column in execution trace?
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 think I do want to trash the graph, this is a relic of my first pass. I will remove it for now.
One thing I also want to do is impl a nice Display for our circuits, so that's on my mind as far as this goes.
11c5902
to
d3258c1
Compare
I made a small little DSL that will allow you to write Rust to generate the arithmetic expressions. My goal is to get this to yield circuits that can then be used along with our polynomial modules and etc.