You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiling a file with above ~1000 local definitions results in stack overflow. These kind of files easily result from relatively simple Juvix programs after recursion unrolling (up to ~140 iterations).
It looks like this overflows during parsing. If this doesn't happen for modules, that suggests that suggests that definitions are parsing let binding in a recursive way that modules aren't.
Increasing the stack size to 16 MB, which can be done using the following main function for example
fn main() {
let builder = thread::Builder::new().stack_size(16 * 1024 * 1024);
let handler = builder.spawn(move || {
let cli = Cli::parse();
match &cli.backend {
Backend::Plonk(plonk_commands) => plonk(plonk_commands),
Backend::Halo2(halo2_commands) => halo2(halo2_commands),
}
}).unwrap();
handler.join().unwrap();
}
fixes the stack overflow. I don't know if this solution is desirable in general, but fixing it otherwise would likely require either changing the syntax of the language to make parsing this sort of file less recursive, or switching to a completely different parser that doesn't use recursive parsing at all/as much.
Compiling a file with above ~1000 local definitions results in stack overflow. These kind of files easily result from relatively simple Juvix programs after recursion unrolling (up to ~140 iterations).
test026.pir
The text was updated successfully, but these errors were encountered: