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

Explore using edamame for parsing #303

Open
lread opened this issue Aug 7, 2024 · 0 comments
Open

Explore using edamame for parsing #303

lread opened this issue Aug 7, 2024 · 0 comments

Comments

@lread
Copy link
Collaborator

lread commented Aug 7, 2024

Both edamame and rewrite-clj parse Clojure code.
Under the hood, they both use clojure tools reader.

Occasionally, @borkdude and I wonder if the parsing code could be shared more.
For example, rewrite-clj implemented parsing of new clojure 1.12 array class syntax, and then edamame did so too. What if we just implemented once in edamame and rewrite-clj took advantage of it?

Initial high-level thoughts:

  • pro: when rewrite-clj decides it needs a parsing update, we would implement it in edamame, and edamame would, therefore, also benefit
  • pro: some parsing tweaks are a bit complex, and dig into clojure tools reader internals. It could be nice to only implement this code once in one place.
  • pro: fix a parsing bug in edamame and rewrite-clj bumps and benefits.
  • pro: rewrite-clj could choose to take advantage of existing edamame features, like maybe reader conditional parsing and incomplete expression parsing
  • pro: borkdude is very involved in both projects, very reasonable, and lovely to work with
  • pro: lee would get a deep understanding of edamame
  • con: this new rewrite-clj dependency means folks could be including a different version of edamame, which could lead to some confusion
  • potential con: would this mean any (even minor) breaking changes to rewrite-clj? TBD

I've opened this issue to explore and track what it might mean to use edamame for parsing in rewrite-clj.

I'll experiment sometime soon to learn more about what issues we need to address, and if it still seems like a good idea, we can work out a plan.

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