Closed ndr-brt closed 3 years ago
Done, thanks to @jwaldmann, now also if the scripts "wont compile", feedforward will start correctly
Great! Will this stop feedforward from crashing on syntax errors too?
Don't think, but we can work on that for sure!
If you have a failing test case, I can look at it.
@yaxu the crash on syntax errors appears when there's an syntax error into the minitidal syntax, because the typeChecksWithDetails
function cannot catch them, and an exception is thrown by interpret
.
The solution is to catch the interpret
solution (already implemented in #21 ), and at this point is possible to get rid of the typeChecksWithDetails
, because the same errors that function catches are also thrown by interpret
(did some trials).
I will commit this on #21
I think we might still want to keep typeChecksWithDetails
. I might be wrong but I think when interpret
raises an error, that requires the interpreter to be relaunched, which is more costly in terms of CPU. This is only a real problem for low powered devices like the pi zero, but that's the platform I originally made feedforward for.
It's relaunched only if the error is not catched, if it went catched the interpreter keeps on working.
BTW, I was wrong on the minitidal syntax error, it keeps on crash on it also with catching error on interpret. will investigate (I will open an issue about that)
Ok!
Implements #14
It's pretty complete, the only thing I wasn't able to implement is catching the
runStmt
exceptions, so now, if the script(s) passed is(are) not valid, the editor starts but the interpreter won't work. At the moment only "file not found" is handled.I tried to pass a
BootTidal.hs
file but it does not work, I think because it does not accept ghc command like:set
. It works if the input script is like:I added optparse-applicative library to handle command line argument passing, it's really nice