-
Notifications
You must be signed in to change notification settings - Fork 86
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
Publish for Dotty #210
Comments
Thank you, Travis! So, my initial approach was to simply wait until someone opens the first "please port to Dotty" ticket. What is http4s using parboiled2 for? HTTP header parsing? The reason I'm a bit caution wrt putting in a lot more work into parboiled2 is that, from my current perspective, I'd regard the basic approach as only half successful. While parsing performance is generally good and error reporting not bad I would, today, go for a different, more flexible and more composable design for modeling parsing rules. |
@sirthias http4s has dozens of Parboiled parsers (~190 rules) for different header types, IP addresses, etc., and currently uses a parboiled2 fork (not exposed in any public APIs) to avoid Shapeless conflicts for users. The fork generally stays pretty close to upstream (right now it's a month and a half behind). We could rewrite these parsers, but my feeling right now is that it'd be less work to get the subset of parboiled2 that's needed to support them working on Dotty. I think I'm about an half-day of work away from that after getting started last weekend—it's close enough to complete that I can work through the non-Parboiled-related compilation errors on Dotty, which was my primary goal at the moment. My plan has been to finish this minimal port in the http4s parboiled2 fork, outline what's missing, and see if there's interest in completing the migration upstream. I definitely understand if there's not, or if that's not a priority for anyone in the immediate future! |
Ok, thank you for this update! |
@travisbrown Did your parboiled branch ever get published? I'm beginning some core model cleanups in http4s, which includes the parsers, and am wondering whether we still think Parboiled2 on Dotty is plausible or if it's time to move on. I agree with @sirthias's comments on composability, but it's nice how the parboiled parsers resemble the RFCs, and the project has treated us well for many years. |
@rossabaker I don't think I've pushed the branch yet, but I'll try to dust it off tomorrow. |
@sirthias Don't let anyone stop you from making an even better parboiled3 using, e.g., scala.meta ;) |
@travisbrown Do you still have that branch anywhere? I'm getting ready to sort out what still needs to be done for http4s so we can plan our Dotty release roadmap, and this is the scariest dragon we've thought of. |
alternatives that are already available for Scala 3 include https://github.com/typelevel/cats-parse (the up-and-comer) and https://github.com/scala/scala-parser-combinators (the old standby; not industrial-strength, but works fine if you don't care about performance) (fastparse has been a popular choice for Scala 2, but Scala 3 support hasn't landed, as per com-lihaoyi/fastparse#246) |
We are extensively using parboiled2, for internal applications, and for sangria If there is any WIP branch, I'd be willing to spend some time continuing the work. |
Travis was very kind and pushed his last changes here: travisbrown@03483e3 I'm taking a look at those. |
It seems that we must choose between scala native & scala 3 for now: scala-native/scala-native#2317 |
You don't have to choose, you can exclude Scala Native/Scala 3 from the matrix, while keeping Scala Native/ Scala 2 |
👍
|
The dependency on shapeless is an issue right now. As shapeless is using macros, I cannot use I'm trying to remove this dependency temporary by copying hlist into parboiled2. It's not a long term solution. |
http4s' fork of parboiled2 existed to remove the shapeless dependency. That
might give you a head start.
…On Mon, May 31, 2021, 11:24 AM Yann Simon ***@***.***> wrote:
The dependency on shapeless is an issue right now. As shapeless is using
macros, I cannot use .cross(CrossVersion.for3Use2_13).
milessabin/shapeless#1043
<milessabin/shapeless#1043>
I'm trying to remove this dependency temporary by copying hlist into
parboiled2. It's not a long term solution.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#210 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABC22WJTHOR6P2PXLIKHSDTQOS2BANCNFSM4LELKDFA>
.
|
Same for akka-http's fork which includes only the essential parts from shapeless for building parboiled2 (which is hlists). |
If some people want to help, I've started a new branch trying to keep a clean history that can be used as base: #274 It's only the basic structure for now, nothing is working. |
New base branch: #280 |
After the awesome work in #280 this is finally done. |
I've started working on this, primarily in order to unblock Dotty cross-building for http4s. I've got most of the combinators ported, including a simplified version of
~>
, and will push a WIP branch soon (probably later this week).I'm not aware of any other attempts to set up Dotty cross-building, and am opening this issue to track progress and help avoid duplicated work.
The text was updated successfully, but these errors were encountered: