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

convert: construct ziggy AST rather than bytes? #52

Open
LewisGaul opened this issue Dec 29, 2024 · 0 comments
Open

convert: construct ziggy AST rather than bytes? #52

LewisGaul opened this issue Dec 29, 2024 · 0 comments

Comments

@LewisGaul
Copy link
Contributor

LewisGaul commented Dec 29, 2024

When converting to ziggy format (JSON->Ziggy being the one mapping currently implemented), would it make more sense to construct a ziggy.Ast object rather than directly writing Ziggy snippets as bytes (via std.ArrayList(u8).writer())?

The main advantage I can see for writing directly is that the writer for the final destination (file/stdout) could be passed through giving streaming output as conversion is performed and reducing memory usage. However, this is not currently done, the writer is simply associated with an ArrayList(u8).

Pros:

  • Less error prone(?)
  • Get proper formatting by simply printing the AST

Cons:

  • Memory impact?

I'd be happy to have a go at this change if there's interest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant