Skip to content
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

Diagnostics container as a trait / callback #87

Open
kaleidawave opened this issue Nov 20, 2023 · 0 comments
Open

Diagnostics container as a trait / callback #87

kaleidawave opened this issue Nov 20, 2023 · 0 comments
Labels
compiler-performance Making parsing / type checking / transformations faster diagnostics related to outputting code errors

Comments

@kaleidawave
Copy link
Owner

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.

@kaleidawave kaleidawave added compiler-performance Making parsing / type checking / transformations faster diagnostics related to outputting code errors labels Nov 20, 2023
@kaleidawave kaleidawave changed the title Diagnostics container as a callaback Diagnostics container as a trait / callback Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler-performance Making parsing / type checking / transformations faster diagnostics related to outputting code errors
Projects
None yet
Development

No branches or pull requests

1 participant