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

Make writing generics more "scary" #448

Open
SeanTAllen opened this issue Sep 16, 2020 · 8 comments
Open

Make writing generics more "scary" #448

SeanTAllen opened this issue Sep 16, 2020 · 8 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@SeanTAllen
Copy link
Member

We cover (briefly) generics in the tutorial.

Using generics that others have written is generally straightforward in Pony but writing generics can be very hard.

As it says on the website.

Generics and references capabilities are the hardest things to get a handle on while learning Pony so don’t get frustrated. It’s not just you. We all go through this. During the video, you’ll hear one of our core team members, Sean T. Allen, commenting at numerous points that he was sort of following everything but not all of it. Sean now has a strong grasp on all the concepts. It takes time.

We should make sure people come away from the generics section of the tutorial with an understanding that using should be straightforward but that writing them is "Pony on hard mode".

@SeanTAllen SeanTAllen added the help wanted Extra attention is needed label Sep 16, 2020
@rhagenson
Copy link
Member

Writing Pony generics is definitely advanced Pony, not intermediate Pony as I thought at one point.

What are you suggesting here? An upfront warning that generics are more difficult than they first appear, or perhaps a final reminder that generics take longer to learn in Pony than other "similar" languages?

@SeanTAllen
Copy link
Member Author

I think we want people to come away with:

  • using shouldn't be an issuing.
  • writing is advanced mode and difficulty level will be higher than other languages because of the unfamiliarity w reference capabilities.

writing generics is probably the hardest thing a pony program will do in terms of interacting with the type system.

@rhagenson
Copy link
Member

rhagenson commented Sep 16, 2020

Understood.

To whoever wants to handle this issue, I am willing to help in writing and/or review. Making something more "scary" is a unique way to contribute so I welcome an outside perspective on the matter.

Edit: Clarify what I mean by help

@rhagenson rhagenson added the good first issue Good for newcomers label Dec 16, 2020
@schnittchen
Copy link
Contributor

Where does the difficulty lie? Getting the reference capabilities (including ephemeral^ or alias! types) right so that the generic is actually useful beyond the first use case at hand?

@rhagenson
Copy link
Member

Ephemeral and alias types are part of the difficulty, yes. A solution to this issue would make that difficulty clear as well as at least preview one way where generics without refcaps are made more complicated (and unsafe) with refcaps added. As refcaps do not exist at runtime all safety must be guaranteed at compile time.

Do you have thoughts on how to approach this section, @schnittchen?

@schnittchen
Copy link
Contributor

For the time being this would be far beyond my capabilities. An idea might be to point into the stdlib and give the reader a hint about some subtleties.

@shaedrich
Copy link
Collaborator

Writing Pony generics is definitely advanced Pony, not intermediate Pony as I thought at one point.

Would it make sense to indicate the knowledge level with some kind of label right at the top of the page, or even display a list there, including the topics, you need to understand in order to consider working with this topic?

@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Mar 23, 2024
@jemc
Copy link
Member

jemc commented Mar 26, 2024

Would it make sense to indicate the knowledge level with some kind of label right at the top of the page, or even display a list there, including the topics, you need to understand in order to consider working with this topic?

We discussed in the Pony sync today.

We think that this kind of generalized system would be somewhat heavy to initially sketch out the content for, and maintain. And the amount of value we get out of that may be fairly low, compared to just mentioning an appropriate comment in the prose.

@SeanTAllen SeanTAllen removed the discuss during sync Should be discussed during an upcoming sync label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants