target / theta-idl

Define communication protocols between applications using algebraic data types.
Other
45 stars 9 forks source link

Removing the haskell-src-exts dependency #67

Closed carlosdagos closed 2 years ago

carlosdagos commented 2 years ago

Whilst compiling I noticed the haskell-src-exts dependency. Unfortunately whilst excellent, that library is now on "life support" thanks to the great work by @DanBurton (thank you!): https://github.com/haskell-suite/haskell-src-exts#maintenance

I ran stack dot --external to visualise the dependencies and got the following output (big big graphviz).

But if we squint (and trim it), we can see instead the following (much easier to read).

So there are two key packages that are bringing in this dependency:

I have yet to read the code and figure out how these are used, it seems like there may be an alternative for example for string-interpolate with PyF which removed the haskell-src-exts dependency back in https://github.com/guibou/PyF/pull/61 (full disclosure: I contribured heavily to that PR :smile:).

With regards to the aeson-qq dependency, perhaps it may not be so easy and I'm willing to see what the maintainer of that package thinks about removing the dependency in an upcoming version.

Lastly, thanks for this project! 🙂

TikhonJelvis commented 2 years ago

Sweet, thanks for the suggestion!

Looks like I don't currently use aeson-qq for anything—not sure why it's in the dependencies! Either I used it in the past and forgot to remove the dependency or I never got around to using it in the first place.

On the other hand, I do use string-interpolate all over the place. PyF seems like a somewhat nicer library overall and fmtTrim seems pretty close to a drop in replacement for my main uses of string-interpolate, but it'll require a bit of working and testing to figure out the details. I should be able to do that over the next couple of days.

carlosdagos commented 2 years ago

Cheers @TikhonJelvis! Thank you so much for your quick response and the PRs you have already opened.

I'm also happy to try and tackle the string-interpolate migration if you're open to receiving PRs 😄

TikhonJelvis commented 2 years ago

Thanks for the offer—always happy to get PRs :)

In this case though, I'm already almost done with those changes. It turned out to be easier than I had thought because I had written my own lightweight quasiquotes for generating code and only used string-interpolate for human-facing text in tests and error messages. I had been worried that I'd have to go through all of my Rust/Python/Kotlin code and tests which would take a while, but luckily that isn't the case.

TikhonJelvis commented 2 years ago

The PyF PR passed all my tests, so should be completely off haskell-src-exts now :)