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

Tracking: The Big Refactor #98

Open
zesterer opened this issue Jan 1, 2024 · 5 comments
Open

Tracking: The Big Refactor #98

zesterer opened this issue Jan 1, 2024 · 5 comments
Labels
help wanted Extra attention is needed rewrite-todo Things to fix during the crate rewrite

Comments

@zesterer
Copy link
Owner

zesterer commented Jan 1, 2024

I think it's clear that Ariadne has been successful in several domains, particularly the hobby langdev space. However, it has several limitations that a rewrite/refactor should address:

  • No support for toggling colour on-and-off
  • ANSI support is assumed, despite this assumption being unreasonable
  • There are very few ways to customise the output (such as label ordering, for example)
  • Terminal size can't be specified so label/note formatting is often broken

Additionally, there are some new features that a refactor could introduce:

  • A generic DOM-like AST for reports (created using builder methods)
  • More flexible structure with elements that can be arbitrarily nested
  • Generic styling for elements
  • Multiple backends (plaintext, ANSI, HTML, LSP JSON, etc.)

Comments welcome!

@zesterer zesterer added help wanted Extra attention is needed rewrite-todo Things to fix during the crate rewrite labels Jan 1, 2024
@CreatorSiSo
Copy link

CreatorSiSo commented Jan 2, 2024

I did a tiny test implementation to try out the user facing api:
https://github.com/CreatorSiSo/ariadne-next/blob/main/src/main.rs
and how a specific backend would be implemented:
https://github.com/CreatorSiSo/ariadne-next/blob/main/src/plaintext.rs

@CorvusPrudens
Copy link

At the very least, providing an AST would make it a lot easier to translate ariadne reports to HTML (if HTML isn't made a first-class backend target), which is a use case I'm very interested in! Any HTML implementation would likely be fairly opinionated, so an AST might even be preferable.

@calder
Copy link
Contributor

calder commented Jan 7, 2024

One small thing that would be nice to fix: Cache::fetch returning references limits possible cache implementations (no RefCell for internally mutable caches for example).

@zesterer
Copy link
Owner Author

zesterer commented Apr 25, 2024

As a point of interest, I've made some initial headway into this on the ariadne2 branch. It's very early days, but it's already capable of showing some basic diagnostics.

@toadslop
Copy link

Keep up the good work! Looking forward to seeing the new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed rewrite-todo Things to fix during the crate rewrite
Projects
None yet
Development

No branches or pull requests

5 participants