Currently all diagnostics (type checking errors, warnings, information items) are buffered into a vector which is output.
There could instead be a case where the errors are passed to a callback that immediately prints them or raises them to some process.
This could:
Use references or format_args! to reduce allocation
Use threads. Type checking could continue while another writes to stdout
Reduce allocating a large vector (in the case where a codebase has A LOT of errors)
The ReadFromFS trait / generic parameter used throughout the checker, could be made into a more CheckingStuff trait that is custom for the checking environment (CLI, WASM project, LSP etc). A more general trait would be less code rewriting and avoid a third (unnecessary) generic parameter.
Currently all diagnostics (type checking errors, warnings, information items) are buffered into a vector which is output.
There could instead be a case where the errors are passed to a callback that immediately prints them or raises them to some process.
This could:
format_args!
to reduce allocationThe
ReadFromFS
trait / generic parameter used throughout the checker, could be made into a moreCheckingStuff
trait that is custom for the checking environment (CLI, WASM project, LSP etc). A more general trait would be less code rewriting and avoid a third (unnecessary) generic parameter.