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

Define the VISION #2772

Merged
merged 1 commit into from
Apr 12, 2022
Merged

Define the VISION #2772

merged 1 commit into from
Apr 12, 2022

Conversation

seanmonstar
Copy link
Member

@seanmonstar seanmonstar commented Mar 8, 2022

This is an overview of what the shape of hyper looks like, but also somewhat zoomed out, so that the vision can survive while the exact minute details might shift and change over time. It starts with what is hyper, defines a framework for how we make decisions, includes use cases we've considered, and then shows how the library can ideally fulfill its purpose.

There's two documents here. The VISION is the main document, and includes a list of prioritized tenets inside it. The TENETS document is supplemental, and goes more in-depth on what the principles mean, and examples of how they've been used before.

This is the first step in the hyper 1.0 timeline.

This blog post includes background and motivation for defining a VISION for hyper.

Feedback very much welcome!


The VISION has been merged.

docs/TENETS.md Outdated Show resolved Hide resolved
docs/TENETS.md Outdated Show resolved Hide resolved
docs/VISION.md Outdated

### Layers

In all cases, a user brings their own runtime and IO to work with hyper. The IO is provided to hyper, and hyper acts on top of it. hyper returns `Future`s that the user then decides how to poll, likely involving their runtime options.

Choose a reason for hiding this comment

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

Could you add something here, and possibly in the tenets, about the degree to which hyper provides optional runtime integration? For instance, hyper currently has an optional runtime feature; what criteria would hyper use to evaluate proposals for additional such features? (e.g. maintainability, not compromising higher-priority tenets) Similarly, what criteria would be used to evaluate (optional) integration with various different versions of traits such as AsyncRead/AsyncWrite?

These seem like questions people will reasonably ask, for which it'd be helpful to have a reference in the tenets and vision.

@nicoburns
Copy link
Contributor

I don't seem to be able to comment on the lines for some reason, so quoting here:

If a message has a content-length, enforce only that many bytes are read or written.

Is this the sort of thing that might be able to be overridden? I've had experiences where I've had to interact with HTTP servers that would send incorrect content-length headers before (I believe if you just accepted all bytes until they closed the connection it would work).

@seanmonstar
Copy link
Member Author

If a message has a content-length, enforce only that many bytes are read or written.

Is this the sort of thing that might be able to be overridden?

I suppose it's possible, but that's a really really big bug. Message length discrepancies are the basis of message smuggling vulnerabilities. But to the point of this document, hyper is Correct first, but if something is really needed, Flexible allows us to provide options to turn some things off.

docs/VISION.md Outdated Show resolved Hide resolved
docs/VISION.md Outdated Show resolved Hide resolved

## Security

The security of hyper is a large part of what makes hyper _protective_. We make

Choose a reason for hiding this comment

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

Other than in the charter, this is the only other usage of the word protective. Would be good to expound on it a bit. This line begs the question: "what other parts of hyper also make it protective?". I think that might already be answered in the doc but it would be good to make the association between the term protective and some of the other points on this doc more explicit. And maybe also explicitly define what we mean by protective somewhere in the doc?

Copy link
Member

@davidpdrsn davidpdrsn left a comment

Choose a reason for hiding this comment

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

❤️

docs/VISION.md Outdated Show resolved Hide resolved
Comment on lines +136 to +138
Motivated by the **Flexible** tenet, there _are_ version-specific options that
can be configured at this level, and version-specific functionality can usually
be handled via `http::Extensions`.
Copy link
Member

Choose a reason for hiding this comment

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

Is it worth discussing what the vision is for cases that fall outside of what can be handled with Extensions? To use the example we discussed in Discord recently, suppose we want to handle custom h2 frames that arrive interleaved with the data frames, which therefore can arrive after the head is received and Extensions can no longer be modified.

Copy link
Member

Choose a reason for hiding this comment

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

#1586 and #2426 are other possibly relevant cases to consider here

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea, it's definitely worth discussing, at least at a high level. We want this to define mechanisms that we used to then outline issues and roadmaps for changing the exact code to get here.

I notice this sentence says "usually", which does already allow some wiggling that not all things can be handled by Extensions. Alternative mechanisms that seem definitely possible could be included in a sentence too.

docs/VISION.md Outdated Show resolved Hide resolved
@LucioFranco
Copy link
Member

Exciting stuff! Thanks sean

docs/TENETS.md Outdated Show resolved Hide resolved
Being _fast_ means we improve throughput, drive down CPU usage, and improve
sustainability.

Fast _enough_. We don't sacrifice sanity for speed.
Copy link

@Yneth Yneth Nov 5, 2022

Choose a reason for hiding this comment

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

any ideas, considerations regarding io uring support which may come with new IO async interface (owned buffers instead of borrowed ones)?

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

Successfully merging this pull request may close these issues.

9 participants