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

Iteration on Functional optics #364

Merged
merged 8 commits into from
Aug 28, 2023

Conversation

jhwgh1968
Copy link
Contributor

@jhwgh1968 jhwgh1968 commented Apr 16, 2023

An early draft to re-write the lenses section as functional optics.

Opened for early comments from @simonsan and @thomasmarsh

Not formatted or link validated yet, I'm looking for a broad content review an accuracy check.

Currently has other CI stuff mixed in to help me maintain my own fork, do not merge.

Will eventually deal with #329

@simonsan
Copy link
Collaborator

Sorry, for taking this long. I will be able to look at it in the upcoming days. (:

@jhwgh1968
Copy link
Contributor Author

@simonsan or @thomasmarsh, I imagine this slipped through the cracks.

Any comments?

@simonsan
Copy link
Collaborator

@simonsan or @thomasmarsh, I imagine this slipped through the cracks.

Any comments?

Oh yes, indeed. It slipped through here! It's bedtime here now, but will definitely look into it tomorrow or Tuesday! Sorry :(

@simonsan simonsan force-pushed the functional_optics_2.0 branch from d5ba5ff to b573a7c Compare July 24, 2023 15:22
@simonsan
Copy link
Collaborator

simonsan commented Jul 24, 2023

@jhwgh1968 could you please remove all the changes to the CI and make the changes against the lenses.md (so renaming optics.md back to lenses.md) first so we can review against it for the overall changes and then before merging we can rename it?

@jhwgh1968 jhwgh1968 force-pushed the functional_optics_2.0 branch from b573a7c to e60c66f Compare July 24, 2023 23:37
@jhwgh1968
Copy link
Contributor Author

Oh yes, indeed. It slipped through here!

No problem. You'll notice I forgot to remind for months 😉

could you please remove all the changes to the CI and make the changes against the lenses.md (so renaming optics.md back to lenses.md) first so we can review against it for the overall changes

Being a complete re-write without even formatting fixed yet (because I expect to significantly rework it), I didn't expect it to be a problem.

Done and done.

@simonsan
Copy link
Collaborator

simonsan commented Jul 25, 2023

could you please remove all the changes to the CI and make the changes against the lenses.md (so renaming optics.md back to lenses.md) first so we can review against it for the overall changes

Being a complete re-write without even formatting fixed yet (because I expect to significantly rework it), I didn't expect it to be a problem.

Done and done.

Ahhhh! You rewrote it completely! Got it, thought you were "just" changing many things. Indeed the rename doesn't make much sense then. I was fooled by reading the introduction sentence and thinking both will be nearly the same with many additions. 😅 Anyway, we can rename it back in the very end now, sorry for the confusion.

Copy link
Collaborator

@simonsan simonsan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First read, so only obvious language feedback in form of a review for now.

In general, I quite like the topic. Understanding serde from a newcomer's POV is very valuable.

My problem here while reading: There is missing a more extensive introductory part, explaining what well be reading, learning and trying to give the bigger picture beforehand. So we have it easier to understand how that all fits together while we are learning about the smaller parts.

Reading it right now, it feels like I'm being thrown into something, rather than slowly/carefully being introduced to each part. If that makes sense. It's just my feeling right now, so I will give more feedback when reading it again (and again, and again... ;) ).

@simonsan simonsan added C-enhancement Category: Enhancements to content S-review Status: A PR that is currently under review or where a review is the next step A-functional Area: Content about Functional Programming labels Jul 27, 2023
@jhwgh1968
Copy link
Contributor Author

Thanks for catching that stuff, @simonsan. I fixed it all, and added more of an overview paragraph.

@jhwgh1968
Copy link
Contributor Author

I am hoping you can get to this soon, @simonsan. I have roughly a month before I will disappear for quite a while, and am hoping to get this in.

If the new beginning looks good, and the material is understandable, I will take it out of draft.

@simonsan
Copy link
Collaborator

I am hoping you can get to this soon, @simonsan. I have roughly a month before I will disappear for quite a while, and am hoping to get this in.

If the new beginning looks good, and the material is understandable, I will take it out of draft.

Yes, I will give it another read the next days! 🤞🏽

Copy link
Collaborator

@simonsan simonsan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the following things I think it's fine! :)

@simonsan simonsan marked this pull request as ready for review August 17, 2023 20:53
@simonsan simonsan changed the title [DRAFT] Functional optics 2.0 Functional optics 2.0 Aug 17, 2023
@simonsan simonsan changed the title Functional optics 2.0 Iteration on Functional optics Aug 17, 2023
@simonsan
Copy link
Collaborator

@thomasmarsh Would be happy, if you can give it a review as well. :)

@simonsan simonsan force-pushed the functional_optics_2.0 branch from fd80fb3 to 22681ab Compare August 18, 2023 18:18
@jhwgh1968
Copy link
Contributor Author

jhwgh1968 commented Aug 19, 2023

Comments fixed, @simonsan.

While I am hesitant to speak for @thomasmarsh, I would note that their account has been inactive for over 6 months. (I'd check their Birdsite account, but I don't have one there myself, so I can't see it with recent management decisions.)

Copy link
Contributor

@neithernut neithernut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and coherent. But I did find a broken sentence which should probably be corrected before merge.

jhwgh1968 and others added 2 commits August 20, 2023 22:30
@simonsan
Copy link
Collaborator

@jhwgh1968 Not sure, if you heard about it, there is another (de-)serialization framework by udoprog: https://github.com/udoprog/musli

Where Müsli differs in design philosophy is twofold:

  • We make use of GATs to provide tighter abstractions, which should be easier for Rust to optimize.
  • We make less use of the Visitor pattern in certain instances where it's deemed unnecessary, such as when decoding collections. The result is usually cleaner decode implementations.
  • Another major aspect where Müsli differs is in the concept of modes (note the M parameter above). Since this is a parameter of the Encode and Decode traits it allows for the same data model to be serialized in many different ways. This is a larger topic and is covered further down.

I find this quite interesting and would be interested in your opinion regarding that, if it makes sense to name as another approach or something?

@jhwgh1968
Copy link
Contributor Author

Link added, @simonsan. How does it look now?

@simonsan
Copy link
Collaborator

Looks good to me, let's give it till Sunday evening this week, and if no comments on changes show up, we'll merge, ok?

Tagging for visibility:
@marcoieni @pickfire @thomasmarsh

@jhwgh1968 jhwgh1968 requested a review from simonsan August 28, 2023 21:29
@simonsan simonsan merged commit bbcf079 into rust-unofficial:main Aug 28, 2023
@simonsan
Copy link
Collaborator

@jhwgh1968 Thanks a lot (also for the reminder ;))! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-functional Area: Content about Functional Programming C-enhancement Category: Enhancements to content S-review Status: A PR that is currently under review or where a review is the next step
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants