-
Notifications
You must be signed in to change notification settings - Fork 2
R1CS output flatbuffer #14
base: master
Are you sure you want to change the base?
Conversation
alex-ozdemir
left a comment
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.
Great! Thanks for doing this.
I think that adding the output format to Cfg is a great idea. My one requested change is for you to continue to develop that idea by:
- moving R1CS writing into the
Cfgmonad, and fetching the configuration from that monad. - adding an entry to the
optionslist (and an appropriate new field to some record in theCfgfile). - ripping out the command-line argument based approach.
I left a few inline comments articulating these steps.
| then ByteString.writeFile path $ encode r1cs | ||
| else writeFile path $ unlines $ map (unwords . map show) $ r1csAsLines r1cs | ||
| writeToR1csFile | ||
| :: (Show s, KnownNat n) => R1CSOutput -> R1CS s n -> FilePath -> IO () |
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 would lift this to the Cfg monad and get the output format from it.
| , _benesThresh :: Int | ||
| } deriving (Show) | ||
|
|
||
| data R1CSOutput = Json | Legacy | FlatBuffer deriving (Show, Eq) |
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 would add this to the configuration system
| where | ||
| parseR1CSOutputFromArgs m | m `isPresent` longOption "json" = Cfg.Json | ||
| | m `isPresent` longOption "flatbuffer" = Cfg.FlatBuffer | ||
| | otherwise = Cfg.Legacy | ||
|
|
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 would drop this (and other asJson handling), in favor of a Cfg-based approach.
#11